summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib
diff options
context:
space:
mode:
authortb <>2024-05-28 15:40:38 +0000
committertb <>2024-05-28 15:40:38 +0000
commitce5b4803a36a06007a2dbe499a78a74f7e4ffd2d (patch)
tree58662c1e8cc9049aa5b0bb12bf13fe1494a5c9e5 /src/lib/libc/stdlib
parent3736b64da9b4f391ef4ec6e13fb42575c1766d50 (diff)
downloadopenbsd-ce5b4803a36a06007a2dbe499a78a74f7e4ffd2d.tar.gz
openbsd-ce5b4803a36a06007a2dbe499a78a74f7e4ffd2d.tar.bz2
openbsd-ce5b4803a36a06007a2dbe499a78a74f7e4ffd2d.zip
Clean up and fix X509V3_EXT_add1_i2d()
When looking at this code I noticed a few leaks. Fixing those leaks was straightforward, but following the code was really hard. This attempts to make the logic a bit clearer. In short, there are 6 mutually exclusive modes for this function (passed in the variable aptly called flags). The default mode is to append the extension of type nid and to error if such an extension already exists. Then there are other modes with varying degree of madness. The existing code didn't make X509V3_ADD_REPLACE explicit, which is confusing. Operations 6-15 would all be treated like X509V3_ADD_REPLACE due to the way the function was written. Handle the supported operations via a switch and error for operations 6-15. This and the elimination of leaks are the only changes of behavior, as validated by relatively extensive test coverage. ok jsing
Diffstat (limited to 'src/lib/libc/stdlib')
0 files changed, 0 insertions, 0 deletions