madler / zlib

A massively spiffy yet delicately unobtrusive compression library.
http://zlib.net/
Other
5.58k stars 2.43k forks source link

strdup: check potential null pointer #996

Closed SafeCoding233 closed 3 weeks ago

SafeCoding233 commented 1 month ago

strdup may return null pointer on memory allocation failures. I added checks to the unchecked calls to strdup.

Neustradamus commented 3 weeks ago

@madler: Have you seen this PR?

madler commented 3 weeks ago

The code in contrib is supported by the respective authors.

Neustradamus commented 2 weeks ago

@madler: The untgz code is done by you (except one by @bgermann):

But here, it is specified: https://github.com/madler/zlib/blob/develop/contrib/untgz/untgz.c


Pedro A. Aranda Gutierrez is @paaguti on GitHub. Jean-loup Gailly is not on GitHub. Cosmin Truta is @ctruta on GitHub.


Can you reopen the @SafeCoding233 PR?

madler commented 2 weeks ago

No, it was not "done" by me. zlib existed long before git or github did. In 2011, I loaded the preceding 16 years of zlib history into git, contribs and all.

Neustradamus commented 2 weeks ago

@madler: I understand! But maybe it is time to remove some codes from contrib, if it is not managed.