Skip to content

Commit

Permalink
Correct path check for ".." (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-rden authored Jun 1, 2024
1 parent f0b9f09 commit 57d7433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion darkhttpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2057,7 +2057,7 @@ static void generate_dir_listing(struct connection *conn, const char *path,
memset(spaces, ' ', maxlen);

/* append ".." entry if not in wwwroot */
if (strcmp(path, "./") != 0)
if (strncmp(path, wwwroot, strlen(path) - 1) != 0)
append(listing, "<a href=\"../\">..</a>/\n");

for (i=0; i<listsize; i++) {
Expand Down

0 comments on commit 57d7433

Please sign in to comment.