Date: Fri, 20 May 2016 06:47:42 +0000 (UTC) From: Don Lewis <truckman@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r300276 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools Message-ID: <201605200647.u4K6lgee088103@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: truckman Date: Fri May 20 06:47:42 2016 New Revision: 300276 URL: https://svnweb.freebsd.org/changeset/base/300276 Log: MFC r299593 Properly compute the size argument to pass to malloc(). Reported by: Coverity CID: 1198856 Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri May 20 06:43:55 2016 (r300275) +++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Fri May 20 06:47:42 2016 (r300276) @@ -798,7 +798,7 @@ parse_server(char *opt_arg) return (-1); if (snmp_client.trans > SNMP_TRANS_UDP && snmp_client.chost == NULL) { - if ((snmp_client.chost = malloc(strlen(SNMP_DEFAULT_LOCAL + 1))) + if ((snmp_client.chost = malloc(strlen(SNMP_DEFAULT_LOCAL) + 1)) == NULL) { syslog(LOG_ERR, "malloc() failed: %s", strerror(errno)); return (-1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605200647.u4K6lgee088103>