Re: SVN r310931 Bad code

2016-12-31 Thread Ngie Cooper (yaneurabeya)
> On Dec 31, 2016, at 06:14, Michael Butler 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

SVN r310931 Bad code

2016-12-31 Thread Michael Butler
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