From brandt@fokus.gmd.de  Fri Feb 23 06:24:10 2001
Return-Path: <brandt@fokus.gmd.de>
Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14])
	by hub.freebsd.org (Postfix) with ESMTP id 6BFB937B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Feb 2001 06:24:08 -0800 (PST)
	(envelope-from brandt@fokus.gmd.de)
Received: from fokus.gmd.de (beagle [193.175.132.100])
	by mailhub.fokus.gmd.de (8.8.8/8.8.8) with ESMTP id PAA23211
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Feb 2001 15:24:07 +0100 (MET)
Received: (from hbb@localhost)
	by fokus.gmd.de (8.11.2/8.11.0) id f1NEO7S43322;
	Fri, 23 Feb 2001 15:24:07 +0100 (CET)
	(envelope-from hbb)
Message-Id: <200102231424.f1NEO7S43322@fokus.gmd.de>
Date: Fri, 23 Feb 2001 15:24:07 +0100 (CET)
From: Hartmut Brandt <brandt@fokus.gmd.de>
Reply-To: brandt@fokus.gmd.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: namespace pollution in lmessages.c
X-Send-Pr-Version: 3.113

>Number:         25308
>Category:       bin
>Synopsis:       libc/locale/lmessages.c declares a global variable 'empty'
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    phantom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 23 06:30:01 PST 2001
>Closed-Date:    Sat Feb 24 05:14:25 PST 2001
>Last-Modified:  Sat Feb 24 05:15:13 PST 2001
>Originator:     brandt@fokus.gmd.de
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
GMD Fokus
>Environment:
System: FreeBSD beagle.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Thu Feb 22 14:07:18 CET 2001 hbb@beagle.fokus.gmd.de:/opt/obj/usr/src/sys/BEAGLE i386


	
>Description:

libc/locale/lmessages.c contains the following definition:

char empty[] = "";

This is a serious namespace pollution. Probably a 'static' is missing.
	
>How-To-Repeat:
	
Link a program which contains a symbol 'empty' and watch the linker to complain.
>Fix:

--- lmessages.c.orig	Fri Feb 23 15:06:44 2001
+++ lmessages.c	Fri Feb 23 15:06:54 2001
@@ -35,7 +35,7 @@
 #define LCMESSAGES_SIZE_MIN \
 		(offsetof(struct lc_messages_T, yesstr) / sizeof(char *))
 
-char empty[] = "";
+static char empty[] = "";
 
 static const struct lc_messages_T _C_messages_locale = {
 	"^[yY]" ,	/* yesexpr */
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->phantom 
Responsible-Changed-By: kris 
Responsible-Changed-When: Fri Feb 23 23:53:42 PST 2001 
Responsible-Changed-Why:  
phantom is responsible for this code 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25308 
State-Changed-From-To: open->closed 
State-Changed-By: phantom 
State-Changed-When: Sat Feb 24 05:14:25 PST 2001 
State-Changed-Why:  
Fixed in rev 1.6 of lmessages.c 


http://www.freebsd.org/cgi/query-pr.cgi?pr=25308 
>Unformatted:
