Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2012 18:27:46 -0700 (PDT)
From:      Zhihao Yuan <lichray@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/173008: catopen(3) uninitialized value in failed entries.
Message-ID:  <50874412.c49a320a.2c63.2c5e@mx.google.com>
Resent-Message-ID: <201210240140.q9O1e1DZ056376@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         173008
>Category:       bin
>Synopsis:       catopen(3) uninitialized value in failed entries.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 24 01:40:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Zhihao Yuan
>Release:        FreeBSD 8.3-STABLE amd64
>Organization:
Northern Illinois University
>Environment:
System: FreeBSD elitebook.hp 8.3-STABLE FreeBSD 8.3-STABLE #4 r240363: Tue Sep 11 10:40:15 CDT 2012 lichray@elitebook.hp:/usr/obj/usr/src/sys/HOUKAGO amd64


	
>Description:
	
	np->catd will be tested on line 340, but failed entries have uninitialized .catd.

	Invalid read under valgrind.

	BTW: Please take a look at standards/172805 also. I suggested some other changes relating to this module there.
>How-To-Repeat:
	
>Fix:

	

--- catclose_uinit.patch begins here ---
diff --git lib/libc/nls/msgcat.c lib/libc/nls/msgcat.c
index 44b1440..2859916 100644
--- lib/libc/nls/msgcat.c
+++ lib/libc/nls/msgcat.c
@@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$");
 				  if (np != NULL) {				\
 				  	np->name = strdup(n);			\
 					np->path = NULL;			\
+					np->catd = NLERR;			\
 					np->lang = (l == NULL) ? NULL :		\
 					    strdup(l);				\
 					np->caterrno = e;			\
--- catclose_uinit.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50874412.c49a320a.2c63.2c5e>