NetBSD Problem Report #44773

From www@NetBSD.org  Sat Mar 26 08:19:40 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 4904663BFC8
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 26 Mar 2011 08:19:40 +0000 (UTC)
Message-Id: <20110326081939.9B4D563BEAD@www.NetBSD.org>
Date: Sat, 26 Mar 2011 08:19:39 +0000 (UTC)
From: henning.petersen@t-online.de
Reply-To: henning.petersen@t-online.de
To: gnats-bugs@NetBSD.org
Subject: Calculation inside sizeof().
X-Send-Pr-Version: www-1.0

>Number:         44773
>Category:       bin
>Synopsis:       Calculation inside sizeof().
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 26 08:20:01 +0000 2011
>Closed-Date:    Sat Mar 26 12:01:52 +0000 2011
>Last-Modified:  Sat Mar 26 12:05:02 +0000 2011
>Originator:     Henning Petersen
>Release:        NetBSD-current
>Organization:
>Environment:
>Description:
Calculation inside sizeof().
>How-To-Repeat:

>Fix:
diff -u -r1.20 cpio.c
--- bin/pax/cpio.c	14 Feb 2009 08:10:06 -0000	1.20
+++ bin/pax/cpio.c	26 Mar 2011 08:10:13 -0000
@@ -649,8 +649,8 @@
 off_t
 vcpio_endrd(void)
 {
-	return (off_t)(sizeof(HD_VCPIO) + sizeof(TRAILER +
-		(VCPIO_PAD(sizeof(HD_VCPIO) + sizeof(TRAILER)))));
+	return (off_t)(sizeof(HD_VCPIO) + sizeof(TRAILER) +
+		(VCPIO_PAD(sizeof(HD_VCPIO) + sizeof(TRAILER))));
 }

 /*
@@ -958,8 +958,8 @@
 off_t
 bcpio_endrd(void)
 {
-	return (off_t)(sizeof(HD_BCPIO) + sizeof(TRAILER +
-		(BCPIO_PAD(sizeof(HD_BCPIO) + sizeof(TRAILER)))));
+	return (off_t)(sizeof(HD_BCPIO) + sizeof(TRAILER) +
+		(BCPIO_PAD(sizeof(HD_BCPIO) + sizeof(TRAILER))));
 }

 /*

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sat, 26 Mar 2011 12:01:52 +0000
State-Changed-Why:
Patch applied, thanks!


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44773 CVS commit: src/bin/pax
Date: Sat, 26 Mar 2011 12:01:08 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Mar 26 12:01:07 UTC 2011

 Modified Files:
 	src/bin/pax: cpio.c

 Log Message:
 Fix bogus paranthesis, From Henning Peternse in PR bin/44773.


 To generate a diff of this commit:
 cvs rdiff -u -r1.20 -r1.21 src/bin/pax/cpio.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.