chantra / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
648606
--- rpm-4.11.1.orig/lib/cpio.c	2014-11-28 12:21:50.444158675 +0100
648606
+++ rpm-4.11.1/lib/cpio.c	2014-11-28 12:22:53.776453253 +0100
648606
@@ -296,6 +296,9 @@
648606
     st->st_rdev = makedev(major, minor);
648606
 
648606
     GET_NUM_FIELD(hdr.namesize, nameSize);
648606
+    if (nameSize <= 0 || nameSize > 4096) {
648606
+        return CPIOERR_BAD_HEADER;
648606
+    }
648606
 
648606
     *path = xmalloc(nameSize + 1);
648606
     read = Fread(*path, nameSize, 1, cpio->fd);