skipcpio.c: fix up cpio magic comparison
PATCH 1/1 skipcpio.c: fix up cpio magic comparison
Nathan McSween (1):
skipcpio.c: Linux only accepts 070701 cpio magic, this also fixes a
comparision of signed char to 0xc7 (type limits)
skipcpio/skipcpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Signature · 1 line
2.4.5
A message that is not in the archive (sent off-list or not yet received): 1435520549-27302-1-git-send-email-nwmcsween-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH 1/1 skipcpio.c: Linux only accepts 070701 cpio magic, this also fixes a comparision of signed char to 0xc7 (type limits)
--- skipcpio/skipcpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
skipcpio/skipcpio.c +2 -3
@@ -59,9 +59,8 @@ int main(int argc, char **argv) }fseek (f,0 ,SEEK_SET ); -/* check, if this is a cpio archive */ -if ((buf[0 ] ==0x71 && buf[1 ] ==0xc7 ) - || (buf[0 ] =='0' && buf[1 ] =='7' && buf[2 ] =='0' && buf[3 ] =='7' && buf[4 ] =='0' && buf[5 ] =='1' )) { +/* check, if this is a cpio archive, linux only accepts "070701" */ +if (!memcmp (buf"070701" ,6 )) {long pos =0 ;/* Search for CPIO_END */
Signature · 1 line
2.4.5
A message that is not in the archive (sent off-list or not yet received): 1435520549-27302-2-git-send-email-nwmcsween-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH] skipcpio.c: Linux only accepts 070701 cpio magic, this also fixes a comparision of signed char to 0xc7 (type limits)
Patchset imported to github.
Pull request:
<https://github.com/haraldh/dracut/compare/master...dracut-mailing-devs:1435520549-27302-2-git-send-email-nwmcsween%40gmail.com>