From 20f8f204c8df3e5119b47e180361cb166a390ece Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 31 Aug 2013 11:01:26 +0400 Subject: [PATCH] Ticket #3064: crash in case of incorrect cpio content within rpm. (cpio_open_archive): handle error of cpio header reading. Signed-off-by: Andrew Borodin --- src/vfs/cpio/cpio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vfs/cpio/cpio.c b/src/vfs/cpio/cpio.c index f1121b4a0..ec79f5973 100644 --- a/src/vfs/cpio/cpio.c +++ b/src/vfs/cpio/cpio.c @@ -737,6 +737,8 @@ cpio_open_archive (struct vfs_s_super *super, const vfs_path_t * vpath, ssize_t status; status = cpio_read_head (vpath_element->class, super); + if (status < 0) + return (-1); switch (status) {