]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
Fix bad usage of strtol()
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Sat, 24 Feb 2024 01:18:55 +0000 (19:18 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Sat, 24 Feb 2024 01:18:55 +0000 (19:18 -0600)
commit6d7985b72fa3462d311aa9421e1342fcaa2deef6
treeee5575b28bd01c488a9f6aa82d18f60f09b9a35d
parent4f622207e365930463c67ca20b24d99e5e8bb46e
Fix bad usage of strtol()

Someone didn't RTFM.

1. Error code wasn't being catched.
2. Second argument was NULL, so the caller had no way of knowing
   whether the string was fully consumed.
2. The code wasn't making sure the input was a clean hex string.
3. The input string wasn't NULL-terminated.

In the end, I ditched strtol(). It's too dangerous and cluttered for
this purpose.
src/rrdp.c
test/rrdp_test.c