Skip to content

Commit

Permalink
Fix crash in ne_path_escapef
Browse files Browse the repository at this point in the history
Functions wasn't checking correctly for NULL before accessing path.

Fixes: #134
  • Loading branch information
janbrummer committed Nov 23, 2023
1 parent d85b401 commit c03df8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ne_uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ char *ne_path_escapef(const char *path, unsigned int flags)
if (flags & NE_PATH_NONRES) mask |= URI_ESCAPE;
if (flags & NE_PATH_NONURI) mask |= URI_NONURI;

for (pnt = (const unsigned char *)path; *pnt != '\0'; pnt++) {
for (pnt = (const unsigned char *)path; pnt && *pnt != '\0'; pnt++) {
count += path_escape_ch(*pnt, mask);
}

Expand Down

0 comments on commit c03df8e

Please sign in to comment.