[PATCH] bzip2recover: Check argc >= 1 && argv[0] != NULL

Naveed Khan naveed@digiscrypt.com
Mon Jun 22 14:21:39 GMT 2026


Hi Mark,

> Yeah, as mentioned in
> https://sourceware.org/bugzilla/show_bug.cgi?id=33046#c5 it is a
> somewhat obscure way of invoking a program. But we can easily work
> around it, as you done here.

Agreed, it's an unusual way to start the program. Since bzip2.c already
guards argv[0] the same way, mirroring it in bzip2recover.c just keeps
the two consistent and avoids the NULL deref in that corner case.

> Pushed.

Thanks for picking it up.

Naveed


More information about the Bzip2-devel mailing list