Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Dec 2016 09:14:52 -0500
From:      Michael Butler <imb@protected-networks.net>
To:        ngie@freebsd.org, freebsd-current <freebsd-current@freebsd.org>
Subject:   SVN r310931 Bad code
Message-ID:  <742de824-6f35-8c91-8603-c5a766e313b4@protected-networks.net>

next in thread | raw e-mail | index | archive | help
At line 1949 of head/contrib/bsnmp/lib/snmpclient.c, you changed ..

-		if ((sc->chost = malloc(strlen(s) + 1)) == NULL) {
+		if ((sc->chost = strdup(strlen(s))) == NULL) {

This can't work as intended since strlen returns the length of the
string not a pointer to it.

I expect this should be ..

		if ((sc->chost = strdup(s)) == NULL) {

	Michael




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?742de824-6f35-8c91-8603-c5a766e313b4>