NetBSD Problem Report #44148
From www@NetBSD.org Wed Nov 24 17:24:33 2010
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 6850A63BAE5
for <gnats-bugs@gnats.NetBSD.org>; Wed, 24 Nov 2010 17:24:33 +0000 (UTC)
Message-Id: <20101124172433.4225B63B95F@www.NetBSD.org>
Date: Wed, 24 Nov 2010 17:24:33 +0000 (UTC)
From: henning.petersen@t-online.de
Reply-To: henning.petersen@t-online.de
To: gnats-bugs@NetBSD.org
Subject: The function catstrg() in usr.bin/xlint/lint1/tree.c is broken.
X-Send-Pr-Version: www-1.0
>Number: 44148
>Category: bin
>Synopsis: The function catstrg() in usr.bin/xlint/lint1/tree.c is broken.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Nov 24 17:25:00 +0000 2010
>Closed-Date: Tue May 03 05:22:11 +0000 2011
>Last-Modified: Tue May 03 05:22:11 +0000 2011
>Originator: Henning Petersen
>Release:
>Organization:
>Environment:
>Description:
The function catstrg() in usr.bin/xlint/lint1/tree.c is broken.
>How-To-Repeat:
Take the following example program:
---- BEGIN -----
#include <stdio.h>
#include <stdarg.h>
#include <syslog.h>
/* PRINTFLIKE1 */
int
myprintf(char *fmt0, ...)
{
va_list va;
va_start(va, fmt0);
vsyslog(LOG_DEBUG, fmt0, va);
va_end(va);
return 0;
}
int main(int argc, char *argv[])
{
long h;
h = (long) argc;
myprintf("Usage: "
"%ld [options]\n" , h);
return argv[0] != NULL;
}
---- END -----
and run
lint -n example.c
which will print (besides other stuff):
myprintf: malformed format string
>Fix:
diff -u -r1.64 tree.c
--- usr.bin/xlint/lint1/tree.c 21 Mar 2010 14:29:04 -0000 1.64
+++ usr.bin/xlint/lint1/tree.c 24 Nov 2010 14:32:30 -0000
@@ -4020,6 +4020,7 @@
(len2 + 1) * sizeof (wchar_t));
free(strg2->st_wcp);
}
+ strg1->st_len = len;
free(strg2);
return (strg1);
>Release-Note:
>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/44148 CVS commit: src/usr.bin/xlint/lint1
Date: Wed, 24 Nov 2010 12:51:11 -0500
Module Name: src
Committed By: christos
Date: Wed Nov 24 17:51:11 UTC 2010
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
PR/44148: Henning Petersen: catstrg() does not set the resulting string length.
To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/xlint/lint1/tree.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: jruoho@NetBSD.org
State-Changed-When: Tue, 03 May 2011 05:22:11 +0000
State-Changed-Why:
Should be fixed.
>Unformatted:
(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.