public inbox for initramfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] skipcpio.c: fix up cpio magic comparison
@ 2015-06-28 19:42 Nathan McSween
       [not found] ` <1435520549-27302-1-git-send-email-nwmcsween-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan McSween @ 2015-06-28 19:42 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Nathan McSween

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(-)

-- 
2.4.5

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] skipcpio.c: Linux only accepts 070701 cpio magic, this also fixes a comparision of signed char to 0xc7 (type limits)
       [not found] ` <1435520549-27302-1-git-send-email-nwmcsween-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-06-28 19:42   ` Nathan McSween
       [not found]     ` <1435520549-27302-2-git-send-email-nwmcsween-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan McSween @ 2015-06-28 19:42 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Nathan McSween

---
 skipcpio/skipcpio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/skipcpio/skipcpio.c b/skipcpio/skipcpio.c
index 445d7f6..486e00f 100644
--- a/skipcpio/skipcpio.c
+++ b/skipcpio/skipcpio.c
@@ -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 */
-- 
2.4.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] skipcpio.c: Linux only accepts 070701 cpio magic, this also fixes a comparision of signed char to 0xc7 (type limits)
       [not found]     ` <1435520549-27302-2-git-send-email-nwmcsween-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-06-28 20:04       ` Dracut GitHub Import Bot
  0 siblings, 0 replies; 3+ messages in thread
From: Dracut GitHub Import Bot @ 2015-06-28 20:04 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

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>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-28 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-28 19:42 [PATCH] skipcpio.c: fix up cpio magic comparison Nathan McSween
     [not found] ` <1435520549-27302-1-git-send-email-nwmcsween-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-06-28 19:42   ` [PATCH] skipcpio.c: Linux only accepts 070701 cpio magic, this also fixes a comparision of signed char to 0xc7 (type limits) Nathan McSween
     [not found]     ` <1435520549-27302-2-git-send-email-nwmcsween-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-06-28 20:04       ` Dracut GitHub Import Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox