Commit Diff
- Commit:
7ef6ceef43f5c7b50cacd03c8026578dcac72e63
- From:
- Omar Polo <op@omarpolo.com>
- Date:
- Message:
- fix possible NULL deref on gophermap' serialize_link it's just a typo: instead of looking for the end of the string pointed by path, if look for the end of uri. reached that point, path is NULL. reported by a gcc 11 warning: "argument 1 null where non-null expected"
- Actions:
- Patch | Tree
--- parser/parser_gophermap.c +++ parser/parser_gophermap.c @@ -245,7 +245,7 @@ serialize_link(struct line *line, const char *text, FI if ((endhost = colon) == NULL && (endhost = path) == NULL) - endhost = strchr(path, '\0'); + endhost = strchr(uri, '\0'); if (colon != NULL) { for (port = colon+1; *port && *port != '/'; ++port)