bin/128096: Failure in memset .

Henning Petersen henning.petersen at t-online.de
Tue Oct 14 16:00:11 UTC 2008


>Number:         128096
>Category:       bin
>Synopsis:       Failure in memset .
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 14 16:00:08 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Henning Petersen
>Release:        current-Freebsd
>Organization:
>Environment:
>Description:

>How-To-Repeat:

>Fix:
--- src/usr.sbin/nscd/agents/services.c	27 Sep 2007 12:30:10 -0000	1.3
+++ src/usr.sbin/nscd/agents/services.c	14 Oct 2008 07:31:06 -0000
@@ -171,7 +171,7 @@
 		if (size > 0) {
 			proto = (char *)malloc(size + 1);
 			assert(proto != NULL);
-			memset(proto, size + 1, 0);
+			memset(proto, 0, size + 1);
 			memcpy(proto, key + sizeof(enum nss_lookup_type) +
 				sizeof(int), size);
 		}


Patch attached with submission follows:

Index: src/usr.sbin/nscd/agents/services.c
===================================================================
RCS file: /usr/ncvs/src/usr.sbin/nscd/agents/services.c,v
retrieving revision 1.3
diff -u -r1.3 services.c
--- src/usr.sbin/nscd/agents/services.c	27 Sep 2007 12:30:10 -0000	1.3
+++ src/usr.sbin/nscd/agents/services.c	14 Oct 2008 07:31:06 -0000
@@ -171,7 +171,7 @@
 		if (size > 0) {
 			proto = (char *)malloc(size + 1);
 			assert(proto != NULL);
-			memset(proto, size + 1, 0);
+			memset(proto, 0, size + 1);
 			memcpy(proto, key + sizeof(enum nss_lookup_type) +
 				sizeof(int), size);
 		}


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


More information about the freebsd-bugs mailing list