NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/52982: [libnbcompat] fix bug in __glob13.c



>Number:         52982
>Category:       lib
>Synopsis:       [libnbcompat] fix bug in __glob13.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 06 16:35:00 +0000 2018
>Originator:     Eitan Adler
>Release:        HEAD
>Organization:
>Environment:
>Description:

>How-To-Repeat:

>Fix:
Index: __glob13.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/libnbcompat/files/__glob13.c,v
retrieving revision 1.4
diff -u -r1.4 __glob13.c
--- __glob13.c	14 Mar 2014 22:08:17 -0000	1.4
+++ __glob13.c	6 Feb 2018 16:29:38 -0000
@@ -594,8 +594,9 @@
 	 * we save one character so that we can use ptr >= limit,
 	 * in the general case when we are appending non nul chars only.
 	 */
-	return(glob2(pathbuf, pathbuf, pathbuf + sizeof(pathbuf) - 1, pattern,
-	    pglob, limit));
+	return glob2(pathbuf, pathbuf,
+		pathbuf + (sizeof(pathbuf) / sizeof(*pathbuf)) - 1, pattern,
+		pglob, limit);
 }
 
 /*



Home | Main Index | Thread Index | Old Index