Author: truckman
Date: Fri May 13 06:45:16 2016
New Revision: 299593
URL: https://svnweb.freebsd.org/changeset/base/299593

Log:
  Properly compute the size argument to pass to malloc().
  
  Reported by:  Coverity
  CID:          1198856
  MFC after:    1 week

Modified:
  head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c

Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
==============================================================================
--- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c       Fri May 13 
06:26:42 2016        (r299592)
+++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c       Fri May 13 
06:45:16 2016        (r299593)
@@ -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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to