add rpmlog(RPMLOG_ERR, ...) for liblzma return codes 74/106474/2
authorPer Øyvind Karlsen <proyvind@moondrake.org>
Wed, 12 Aug 2015 01:12:27 +0000 (03:12 +0200)
committerpark <sk7.park@samsung.com>
Mon, 2 Jan 2017 10:36:48 +0000 (02:36 -0800)
Change-Id: I25c017827b38e2141dcff4d6bfd398f9e1a008c2

rpmio/rpmio.c

index 2d35c12..60da8be 100644 (file)
@@ -934,6 +934,19 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x
        ret = lzma_auto_decoder(&lzfile->strm, 100<<20, 0);
     }
     if (ret != LZMA_OK) {
+       switch (ret) {
+           case LZMA_MEM_ERROR:
+               rpmlog(RPMLOG_ERR, "liblzma: Memory allocation failed");
+               break;
+
+           case LZMA_DATA_ERROR:
+               rpmlog(RPMLOG_ERR, "liblzma: File size limits exceeded");
+               break;
+
+           default:
+               rpmlog(RPMLOG_ERR, "liblzma: <Unknown error (%d), possibly a bug", ret);
+               break;
+       }
        fclose(fp);
        free(lzfile);
        return 0;