commit 7ef6ceef43f5c7b50cacd03c8026578dcac72e63 from: Omar Polo date: Thu May 19 07:48:49 2022 UTC 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" commit - 4aadc3984f253a733f0748c14b3f2644b50be4a4 commit + 7ef6ceef43f5c7b50cacd03c8026578dcac72e63 blob - c83b714cad0ef63cb34b5680ccd33f0595d0ca81 blob + b20293aeda9f07ba732badc4c7c7e684e05acd4b --- 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)