From owner-freebsd-bugs@FreeBSD.ORG Sun Aug 24 23:10:04 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A312A16A4BF for ; Sun, 24 Aug 2003 23:10:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CD6843FE0 for ; Sun, 24 Aug 2003 23:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h7P6A3Up086451 for ; Sun, 24 Aug 2003 23:10:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h7P6A3Dc086450; Sun, 24 Aug 2003 23:10:03 -0700 (PDT) Resent-Date: Sun, 24 Aug 2003 23:10:03 -0700 (PDT) Resent-Message-Id: <200308250610.h7P6A3Dc086450@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mark Valentine Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 413C416A4BF for ; Sun, 24 Aug 2003 23:01:16 -0700 (PDT) Received: from pengo.systems.pipex.net (pengo.systems.pipex.net [62.241.160.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 49B2D43FB1 for ; Sun, 24 Aug 2003 23:01:13 -0700 (PDT) (envelope-from mark@thuvia.org) Received: from dotar.thuvia.org (81-86-238-214.dsl.pipex.com [81.86.238.214]) by pengo.systems.pipex.net (Postfix) with ESMTP id 8A1164C00A92 for ; Mon, 25 Aug 2003 07:01:10 +0100 (BST) Received: from dotar.thuvia.org (localhost [127.0.0.1]) by dotar.thuvia.org (8.12.9/8.12.9) with ESMTP id h7P61AjE054558 for ; Mon, 25 Aug 2003 07:01:10 +0100 (BST) (envelope-from mark@dotar.thuvia.org) Received: (from mark@localhost) by dotar.thuvia.org (8.12.9/8.12.9/Submit) id h7P61Avj054557; Mon, 25 Aug 2003 07:01:10 +0100 (BST) (envelope-from mark) Message-Id: <200308250601.h7P61Avj054557@dotar.thuvia.org> Date: Mon, 25 Aug 2003 07:01:10 +0100 (BST) From: Mark Valentine To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/55947: printf(1) mishandles \0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Mark Valentine List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Aug 2003 06:10:04 -0000 >Number: 55947 >Category: bin >Synopsis: printf(1) mishandles \0 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 24 23:10:03 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Mark Valentine >Release: FreeBSD 4.8-STABLE i386 >Organization: >Environment: System: FreeBSD dotar.thuvia.org 4.8-STABLE FreeBSD 4.8-STABLE #6: Wed Jun 11 15:04:41 BST 2003 root@dotar.thuvia.org:/usr/obj/usr/src/sys/DOTAR i386 >Description: printf(1) doesn't handle the sequence \0 correctly in format strings: $ printf 'foo\0bar' | hd 00000000 66 6f 6f |foo| 00000003 The expected result is: $ printf 'foo\0bar' | hd 00000000 66 6f 6f 00 62 61 72 |foo.bar| 00000007 >How-To-Repeat: >Fix: Borrow code from NetBSD's printf(1)... >Release-Note: >Audit-Trail: >Unformatted: