diff options
author | tb <> | 2020-11-25 21:17:52 +0000 |
---|---|---|
committer | tb <> | 2020-11-25 21:17:52 +0000 |
commit | e184d9b4d57f92ba4003625ca5e4bf386ad6843f (patch) | |
tree | 6658abd0ba870d77cbb0aa60a0607146508d9159 /src/lib/libc | |
parent | 4594ab4487e73070cff05c330cce9ed796246510 (diff) | |
download | openbsd-e184d9b4d57f92ba4003625ca5e4bf386ad6843f.tar.gz openbsd-e184d9b4d57f92ba4003625ca5e4bf386ad6843f.tar.bz2 openbsd-e184d9b4d57f92ba4003625ca5e4bf386ad6843f.zip |
Avoid undefined behavior due to memcpy(NULL, NULL, 0)
This happens if name->der_len == 0. Since we already have a length
check, we can malloc and memcpy inside the conditional. This also
makes the code easier to read.
agreement from millert
ok jsing
Diffstat (limited to 'src/lib/libc')
0 files changed, 0 insertions, 0 deletions