Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Oct 2008 15:59:41 GMT
From:      Henning Petersen <henning.petersen@t-online.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/128096: Failure in memset .
Message-ID:  <200810141559.m9EFxfjk016904@www.freebsd.org>
Resent-Message-ID: <200810141600.m9EG083q013512@freefall.freebsd.org>

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

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810141559.m9EFxfjk016904>