Date: Fri, 23 May 2008 13:51:49 +0900 (JST) From: Katsuyuki Miyoshi <katsu@miyoshi.matsuyama.ehime.jp> To: FreeBSD-gnats-submit@FreeBSD.org Subject: gnu/123921: cpio -oc bug with write_out_header() Message-ID: <20080523045149.2FAB85E8402@kmgw.miyoshi.matsuyama.ehime.jp> Resent-Message-ID: <200805230520.m4N5K1JC074982@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 123921 >Category: gnu >Synopsis: cpio -oc bug with write_out_header() >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 23 05:20:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Katsuyuki Miyoshi >Release: FreeBSD 8.0-CURRENT i386 >Organization: Katsuyuki Miyoshi, Ehime, Japan. >Environment: System: FreeBSD kmgw.miyoshi.matsuyama.ehime.jp 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Wed May 21 20:18:53 JST 2008 root@kmgw.miyoshi.matsuyama.ehime.jp:/usr/obj/usr/src/sys/KMGW i386 >Description: cpio cannot use with -c option. >How-To-Repeat: % find foo | cpio -oc > foo.cpio Internal overflow, aborting >Fix: --- contrib/cpio/src/copyout.c.org 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@prep.ai.mit.edu". (1998/5/26) -BEM */ - snprintf (ascii_header, sizeof(ascii_header), + ret = snprintf (ascii_header, sizeof(ascii_header), "%06ho%06lo%06lo%06lo%06lo%06lo%06lo%06lo%011lo%06lo%011lo", file_hdr->c_magic & 0xFFFF, (long) dev & 0xFFFF, file_hdr->c_ino & 0xFFFF, file_hdr->c_mode & 0xFFFF, >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080523045149.2FAB85E8402>