]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
File: Patch undefined behavior
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 3 Feb 2022 21:43:27 +0000 (15:43 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 3 Feb 2022 21:43:50 +0000 (15:43 -0600)
commite1dc802ec8b31f9f48c8cd88a74993e675b1e35d
tree60dda9ba806dedf8fbddb6b27ef0619b54f815de
parentfc2a5418f5c36f6be3ed68917c56a1154acadf25
File: Patch undefined behavior

Code was falling into the `strchr()` trap:

last_slash = strrchr(path, '/');
*last_slash = '\0';

`path` is const, and `strrchr()` returns a pointer to the same string,
so the second line was risking a const edit.

Also fixes some leftover compilation problems.
src/file.c
src/http/http.c
src/rrdp/delta.c
src/rrdp/snapshot.c
src/rrdp/types.c
src/rrdp/types.h