Re: [PATCH] rpm2cpio: print name of unknown compression method
Denys Vlasenko via busybox <[email protected]>
| Newsgroups | gmane.linux.busybox |
|---|---|
| Message-ID | <CAK1hOcMXSuqdWnw9BQb7f=MhBy-jC6jjDyfkoaraA8BWeUo6KA@mail.gmail.com> |
Applied, thank you. On Tue, Mar 24, 2026 at 12:51 PM Ron Yorston via busybox <[email protected]> wrote: > > Commit f13f68288 (rpm2cpio: extract cpio even if compression is > not known) added an error message if the compression method was > unknown. When support for lzma was disabled this resulted in a > null pointer being passed to bb_error_msg(). > > The call to rpm_getstr0() to fetch the name of the compression > method shouldn't depend on lzma being supported. > > This doesn't affect the size of a default build. In a build with > lzma disabled: > > function old new delta > rpm2cpio_main 110 121 +11 > ------------------------------------------------------------------------------ > (add/remove: 0/0 grow/shrink: 1/0 up/down: 11/0) Total: 11 bytes > > Signed-off-by: Ron Yorston <[email protected]> > --- > archival/rpm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/archival/rpm.c b/archival/rpm.c > index 95a8c79b6..899587751 100644 > --- a/archival/rpm.c > +++ b/archival/rpm.c > @@ -533,9 +533,9 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv) > // /* We need to know whether child (gzip/bzip/etc) exits abnormally */ > // signal(SIGCHLD, check_errors_in_children); > > - str = NULL; > + str = rpm_getstr0(TAG_PAYLOADCOMPRESSOR); > if (ENABLE_FEATURE_SEAMLESS_LZMA > - && (str = rpm_getstr0(TAG_PAYLOADCOMPRESSOR)) != NULL > + && str != NULL > && strcmp(str, "lzma") == 0 > ) { > // lzma compression can't be detected > -- > 2.53.0 > > _______________________________________________ > busybox mailing list > [email protected] > https://lists.busybox.net/mailman/listinfo/busybox _______________________________________________ busybox mailing list [email protected] https://lists.busybox.net/mailman/listinfo/busybox