SVN r310931 Bad code

Michael Butler imb at protected-networks.net
Sat Dec 31 14:15:02 UTC 2016


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



More information about the freebsd-current mailing list