Re: SVN r310931 Bad code

From: Ngie Cooper (yaneurabeya) <"Ngie>
Date: Sat, 31 Dec 2016 12:55:08 -0800
> On Dec 31, 2016, at 06:14, Michael Butler <imb_at_protected-networks.net> wrote:
> 
> 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) {

	Yeah… egg on my face... I fixed it in r310942.
Sorry for the breakage :/…
-Ngie

Received on Sat Dec 31 2016 - 19:55:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:09 UTC