diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-05-20 13:04:08 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-05-20 13:06:44 -0700 |
commit | ab11cfec562772e540468fc861d8acb1a38b5fad (patch) | |
tree | 32043c6aa0970fcc294dcc96b609035f72034619 | |
parent | 5b0c98895caa066a760384cf1967ceb966151f04 (diff) |
Fix #1: Segmentation fault on trailing slashes
dodir may pass a NULL pointer for the **p argument so we verify the
pointer is not NULL before dereferencing it.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | lndir.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -127,7 +127,7 @@ equivalent(char *lname, const char *rname, char **p) while (s[1] == '/') { size_t len = strlen(s+2); memmove(s+1, s+2, len+1); - if (*p) (*p)--; + if (p && *p) (*p)--; } } return !strcmp(lname, rname); |