gnu/123921: cpio -oc bug with write_out_header()

Katsuyuki Miyoshi katsu at
Fri May 23 05:20:01 UTC 2008

>Number:         123921
>Category:       gnu
>Synopsis:       cpio -oc bug with write_out_header()
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 23 05:20:01 UTC 2008
>Originator:     Katsuyuki Miyoshi
>Release:        FreeBSD 8.0-CURRENT i386
Katsuyuki Miyoshi, Ehime, Japan.
System: FreeBSD 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Wed May 21 20:18:53 JST 2008 root at i386

	 cpio cannot use with -c option.
	% find foo | cpio -oc > foo.cpio
	Internal overflow, aborting
--- contrib/cpio/src/	2006-01-11 21:38:05.000000000 +0900
+++ contrib/cpio/src/copyout.c	2008-05-23 13:27:13.000000000 +0900
@@ -371,7 +371,7 @@ write_out_header (struct new_cpio_header
       /* Debian hack: The type of dev_t has changed in glibc.  Fixed output
          to ensure that a long int is passed to sprintf.  This has been
          reported to "bug-gnu-utils at". (1998/5/26) -BEM */
-      snprintf (ascii_header, sizeof(ascii_header),
+      ret = snprintf (ascii_header, sizeof(ascii_header),
 	       file_hdr->c_magic & 0xFFFF, (long) dev & 0xFFFF,
 	       file_hdr->c_ino & 0xFFFF, file_hdr->c_mode & 0xFFFF,


More information about the freebsd-bugs mailing list