* cpio.c (cpio_find_head): Fix for logical error that can cause

crash on broken cpio archives.
This commit is contained in:
Pavel Roskin 2005-03-29 05:24:26 +00:00
parent 6a821c30cf
commit fc6e8e67f2
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2005-03-29 Pavel Roskin <proski@gnu.org>
* cpio.c (cpio_find_head): Fix for logical error that can cause
crash on broken cpio archives.
2005-02-22 Roland Illig <roland.illig@gmx.de>
* *.c: Declared unused variables with (void) to avoid the gcc
@ -37,7 +42,7 @@
* samba/libsmb/nmblib.c: Comment out matching_bits(), sort_ip,
name_query_comp() and sort_query_replies().
2005-02-12 Jindrich Novy <jnovy@redhat.com>
2005-02-12 Jindrich Novy <jnovy@redhat.com>
* vfs.c (vfs_translate_url): Add support for smb://, sh://,
ssh:// and mc:// filesystem requests. Introduced separate table
@ -49,8 +54,8 @@
2005-02-12 Andrew V. Samoilov <sav@bcs.zp.ua>
* samba/lib/netmask.c [HAVE_NETMASK_AIX && HAVE_UNISTD_H]: Include
<unistd.h> to fix gcc 3.3 warnings about undeclared close().
* samba/lib/netmask.c [HAVE_NETMASK_AIX && HAVE_UNISTD_H]: Include
<unistd.h> to fix gcc 3.3 warnings about undeclared close().
2005-02-09 Roland Illig <roland.illig@gmx.de>

View File

@ -234,8 +234,8 @@ static int cpio_find_head(struct vfs_class *me, struct vfs_s_super *super)
if(ptr + MAGIC_LENGTH >= top) {
if(top > 128) {
memmove(buf, buf + top - 128, 128);
top = 128;
ptr -= top - 128;
top = 128;
}
if((tmp = mc_read(super->u.arch.fd, buf, top)) == 0 || tmp == -1) {
message (1, MSG_ERROR, _("Premature end of cpio archive\n%s"), super->name);