Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 223
Examining data/apcupsd-3.14.14/doc/coverity/model.c
Examining data/apcupsd-3.14.14/examples/client.c
Examining data/apcupsd-3.14.14/examples/hid-set.c
Examining data/apcupsd-3.14.14/examples/hid-ups.c
Examining data/apcupsd-3.14.14/examples/hiddev.h
Examining data/apcupsd-3.14.14/examples/libusb.h
Examining data/apcupsd-3.14.14/examples/megaclient.c
Examining data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c
Examining data/apcupsd-3.14.14/examples/newslave.c
Examining data/apcupsd-3.14.14/examples/smartsim.c
Examining data/apcupsd-3.14.14/examples/snoopdecode.c
Examining data/apcupsd-3.14.14/examples/upsapm.c
Examining data/apcupsd-3.14.14/include/HidUps.h
Examining data/apcupsd-3.14.14/include/aarray.h
Examining data/apcupsd-3.14.14/include/aiter.h
Examining data/apcupsd-3.14.14/include/alist.h
Examining data/apcupsd-3.14.14/include/amap.h
Examining data/apcupsd-3.14.14/include/amutex.h
Examining data/apcupsd-3.14.14/include/apc.h
Examining data/apcupsd-3.14.14/include/aqueue.h
Examining data/apcupsd-3.14.14/include/astring.h
Examining data/apcupsd-3.14.14/include/athread.h
Examining data/apcupsd-3.14.14/include/atimer.h
Examining data/apcupsd-3.14.14/include/autil.h
Examining data/apcupsd-3.14.14/include/defines.h
Examining data/apcupsd-3.14.14/include/drivers.h
Examining data/apcupsd-3.14.14/include/extern.h
Examining data/apcupsd-3.14.14/include/getopt.h
Examining data/apcupsd-3.14.14/include/md5.h
Examining data/apcupsd-3.14.14/include/nis.h
Examining data/apcupsd-3.14.14/include/statmgr.h
Examining data/apcupsd-3.14.14/include/struct.h
Examining data/apcupsd-3.14.14/include/usb_common.h
Examining data/apcupsd-3.14.14/include/version.h
Examining data/apcupsd-3.14.14/src/apcagent/AppController.h
Examining data/apcupsd-3.14.14/src/apcagent/InstanceConfig.h
Examining data/apcupsd-3.14.14/src/apcagent/InstanceManager.h
Examining data/apcupsd-3.14.14/src/apcagent/NSString+uuid.h
Examining data/apcupsd-3.14.14/src/apcnis.c
Examining data/apcupsd-3.14.14/src/apctest.c
Examining data/apcupsd-3.14.14/src/apcupsd.c
Examining data/apcupsd-3.14.14/src/cgi/cgilib.c
Examining data/apcupsd-3.14.14/src/cgi/cgilib.h
Examining data/apcupsd-3.14.14/src/cgi/multimon.c
Examining data/apcupsd-3.14.14/src/cgi/upsfetch.c
Examining data/apcupsd-3.14.14/src/cgi/upsfetch.h
Examining data/apcupsd-3.14.14/src/cgi/upsfstats.c
Examining data/apcupsd-3.14.14/src/cgi/upsimage.c
Examining data/apcupsd-3.14.14/src/cgi/upsstats.c
Examining data/apcupsd-3.14.14/src/device.c
Examining data/apcupsd-3.14.14/src/drivers/apcsmart/apcsmart.h
Examining data/apcupsd-3.14.14/src/drivers/apcsmart/smart.c
Examining data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c
Examining data/apcupsd-3.14.14/src/drivers/apcsmart/smartoper.c
Examining data/apcupsd-3.14.14/src/drivers/apcsmart/smartsetup.c
Examining data/apcupsd-3.14.14/src/drivers/apcsmart/smartsetup2.c
Examining data/apcupsd-3.14.14/src/drivers/drivers.c
Examining data/apcupsd-3.14.14/src/drivers/dumb/dumb.h
Examining data/apcupsd-3.14.14/src/drivers/dumb/dumboper.c
Examining data/apcupsd-3.14.14/src/drivers/dumb/dumbsetup.c
Examining data/apcupsd-3.14.14/src/drivers/modbus/ModbusComm.cpp
Examining data/apcupsd-3.14.14/src/drivers/modbus/ModbusComm.h
Examining data/apcupsd-3.14.14/src/drivers/modbus/ModbusRs232Comm.cpp
Examining data/apcupsd-3.14.14/src/drivers/modbus/ModbusRs232Comm.h
Examining data/apcupsd-3.14.14/src/drivers/modbus/ModbusUsbComm.cpp
Examining data/apcupsd-3.14.14/src/drivers/modbus/ModbusUsbComm.h
Examining data/apcupsd-3.14.14/src/drivers/modbus/mapping.cpp
Examining data/apcupsd-3.14.14/src/drivers/modbus/mapping.h
Examining data/apcupsd-3.14.14/src/drivers/modbus/modbus.cpp
Examining data/apcupsd-3.14.14/src/drivers/modbus/modbus.h
Examining data/apcupsd-3.14.14/src/drivers/net/net.c
Examining data/apcupsd-3.14.14/src/drivers/net/net.h
Examining data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c
Examining data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.h
Examining data/apcupsd-3.14.14/src/drivers/snmplite/apc-mib.cpp
Examining data/apcupsd-3.14.14/src/drivers/snmplite/apc-oids.h
Examining data/apcupsd-3.14.14/src/drivers/snmplite/asn.cpp
Examining data/apcupsd-3.14.14/src/drivers/snmplite/asn.h
Examining data/apcupsd-3.14.14/src/drivers/snmplite/mge-mib.cpp
Examining data/apcupsd-3.14.14/src/drivers/snmplite/mge-oids.h
Examining data/apcupsd-3.14.14/src/drivers/snmplite/mibs.cpp
Examining data/apcupsd-3.14.14/src/drivers/snmplite/mibs.h
Examining data/apcupsd-3.14.14/src/drivers/snmplite/rfc1628-mib.cpp
Examining data/apcupsd-3.14.14/src/drivers/snmplite/rfc1628-oids.h
Examining data/apcupsd-3.14.14/src/drivers/snmplite/snmp.cpp
Examining data/apcupsd-3.14.14/src/drivers/snmplite/snmp.h
Examining data/apcupsd-3.14.14/src/drivers/snmplite/snmplite-common.h
Examining data/apcupsd-3.14.14/src/drivers/snmplite/snmplite.cpp
Examining data/apcupsd-3.14.14/src/drivers/snmplite/snmplite.h
Examining data/apcupsd-3.14.14/src/drivers/snmplite/traps.h
Examining data/apcupsd-3.14.14/src/drivers/test/testdriver.c
Examining data/apcupsd-3.14.14/src/drivers/test/testdriver.h
Examining data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c
Examining data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.h
Examining data/apcupsd-3.14.14/src/drivers/usb/bsd/hidutils.c
Examining data/apcupsd-3.14.14/src/drivers/usb/bsd/hidutils.h
Examining data/apcupsd-3.14.14/src/drivers/usb/generic/generic-usb.c
Examining data/apcupsd-3.14.14/src/drivers/usb/generic/generic-usb.h
Examining data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c
Examining data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.h
Examining data/apcupsd-3.14.14/src/drivers/usb/usb.c
Examining data/apcupsd-3.14.14/src/drivers/usb/usb.h
Examining data/apcupsd-3.14.14/src/gapcmon/eggtrayicon.c
Examining data/apcupsd-3.14.14/src/gapcmon/eggtrayicon.h
Examining data/apcupsd-3.14.14/src/gapcmon/gapcmon.h
Examining data/apcupsd-3.14.14/src/gapcmon/gethostname.c
Examining data/apcupsd-3.14.14/src/gapcmon/gapcmon.c
Examining data/apcupsd-3.14.14/src/lib/amutex.cpp
Examining data/apcupsd-3.14.14/src/lib/apcconfig.c
Examining data/apcupsd-3.14.14/src/lib/apcerror.c
Examining data/apcupsd-3.14.14/src/lib/apcevents.c
Examining data/apcupsd-3.14.14/src/lib/apcexec.c
Examining data/apcupsd-3.14.14/src/lib/apcfile.c
Examining data/apcupsd-3.14.14/src/lib/apclibnis.c
Examining data/apcupsd-3.14.14/src/lib/apclock.c
Examining data/apcupsd-3.14.14/src/lib/apclog.c
Examining data/apcupsd-3.14.14/src/lib/apcsignal.c
Examining data/apcupsd-3.14.14/src/lib/apcstatus.c
Examining data/apcupsd-3.14.14/src/lib/astring.cpp
Examining data/apcupsd-3.14.14/src/lib/asys.c
Examining data/apcupsd-3.14.14/src/lib/athread.cpp
Examining data/apcupsd-3.14.14/src/lib/atimer.cpp
Examining data/apcupsd-3.14.14/src/lib/autil.cpp
Examining data/apcupsd-3.14.14/src/lib/cloexec.c
Examining data/apcupsd-3.14.14/src/lib/gethostname.c
Examining data/apcupsd-3.14.14/src/lib/getopt.c
Examining data/apcupsd-3.14.14/src/lib/getopt1.c
Examining data/apcupsd-3.14.14/src/lib/inet_pton.c
Examining data/apcupsd-3.14.14/src/lib/libsupc++fix.cpp
Examining data/apcupsd-3.14.14/src/lib/localtime_r.c
Examining data/apcupsd-3.14.14/src/lib/md5.c
Examining data/apcupsd-3.14.14/src/lib/memmove.c
Examining data/apcupsd-3.14.14/src/lib/nanosleep.c
Examining data/apcupsd-3.14.14/src/lib/newups.c
Examining data/apcupsd-3.14.14/src/lib/statmgr.cpp
Examining data/apcupsd-3.14.14/src/lib/strcasecmp.c
Examining data/apcupsd-3.14.14/src/lib/strstr.c
Examining data/apcupsd-3.14.14/src/lib/usbvidpid.cpp
Examining data/apcupsd-3.14.14/src/libusbhid/HidUps.cpp
Examining data/apcupsd-3.14.14/src/libusbhid/data.c
Examining data/apcupsd-3.14.14/src/libusbhid/descr.c
Examining data/apcupsd-3.14.14/src/libusbhid/parse.c
Examining data/apcupsd-3.14.14/src/libusbhid/usage.c
Examining data/apcupsd-3.14.14/src/libusbhid/usbcompat.h
Examining data/apcupsd-3.14.14/src/libusbhid/usbhid.h
Examining data/apcupsd-3.14.14/src/libusbhid/usbvar.h
Examining data/apcupsd-3.14.14/src/options.c
Examining data/apcupsd-3.14.14/src/reports.c
Examining data/apcupsd-3.14.14/src/smtp.c
Examining data/apcupsd-3.14.14/src/win32/apctray.cpp
Examining data/apcupsd-3.14.14/src/win32/background.c
Examining data/apcupsd-3.14.14/src/win32/balloonmgr.cpp
Examining data/apcupsd-3.14.14/src/win32/balloonmgr.h
Examining data/apcupsd-3.14.14/src/win32/compat/arpa/inet.h
Examining data/apcupsd-3.14.14/src/win32/compat/compat.cpp
Examining data/apcupsd-3.14.14/src/win32/compat/compat.h
Examining data/apcupsd-3.14.14/src/win32/compat/errno.h
Examining data/apcupsd-3.14.14/src/win32/compat/fcntl.c
Examining data/apcupsd-3.14.14/src/win32/compat/fcntl.h
Examining data/apcupsd-3.14.14/src/win32/compat/inet_aton.c
Examining data/apcupsd-3.14.14/src/win32/compat/ioctl.c
Examining data/apcupsd-3.14.14/src/win32/compat/kill.c
Examining data/apcupsd-3.14.14/src/win32/compat/libusb-winusb-bridge.c
Examining data/apcupsd-3.14.14/src/win32/compat/libusb-winusb-bridge.h
Examining data/apcupsd-3.14.14/src/win32/compat/mswinver.h
Examining data/apcupsd-3.14.14/src/win32/compat/netdb.h
Examining data/apcupsd-3.14.14/src/win32/compat/netinet/in.h
Examining data/apcupsd-3.14.14/src/win32/compat/pathconf.c
Examining data/apcupsd-3.14.14/src/win32/compat/pwd.h
Examining data/apcupsd-3.14.14/src/win32/compat/signal.h
Examining data/apcupsd-3.14.14/src/win32/compat/sleep.c
Examining data/apcupsd-3.14.14/src/win32/compat/string.h
Examining data/apcupsd-3.14.14/src/win32/compat/sys/ioctl.h
Examining data/apcupsd-3.14.14/src/win32/compat/sys/socket.h
Examining data/apcupsd-3.14.14/src/win32/compat/sys/termios.h
Examining data/apcupsd-3.14.14/src/win32/compat/sys/types.h
Examining data/apcupsd-3.14.14/src/win32/compat/sys/wait.h
Examining data/apcupsd-3.14.14/src/win32/compat/syslog.c
Examining data/apcupsd-3.14.14/src/win32/compat/syslog.h
Examining data/apcupsd-3.14.14/src/win32/compat/tcflush.c
Examining data/apcupsd-3.14.14/src/win32/compat/tcgetattr.c
Examining data/apcupsd-3.14.14/src/win32/compat/tcsetattr.c
Examining data/apcupsd-3.14.14/src/win32/compat/termios.h
Examining data/apcupsd-3.14.14/src/win32/compat/unistd.h
Examining data/apcupsd-3.14.14/src/win32/compat/waitpid.c
Examining data/apcupsd-3.14.14/src/win32/compat/winapi.c
Examining data/apcupsd-3.14.14/src/win32/compat/winapi.h
Examining data/apcupsd-3.14.14/src/win32/compat/winsock.h
Examining data/apcupsd-3.14.14/src/win32/compat/winusb.h
Examining data/apcupsd-3.14.14/src/win32/email.c
Examining data/apcupsd-3.14.14/src/win32/instmgr.cpp
Examining data/apcupsd-3.14.14/src/win32/instmgr.h
Examining data/apcupsd-3.14.14/src/win32/listview.cpp
Examining data/apcupsd-3.14.14/src/win32/listview.h
Examining data/apcupsd-3.14.14/src/win32/meter.cpp
Examining data/apcupsd-3.14.14/src/win32/meter.h
Examining data/apcupsd-3.14.14/src/win32/popup.c
Examining data/apcupsd-3.14.14/src/win32/resource.h
Examining data/apcupsd-3.14.14/src/win32/shutdown.c
Examining data/apcupsd-3.14.14/src/win32/winabout.cpp
Examining data/apcupsd-3.14.14/src/win32/winabout.h
Examining data/apcupsd-3.14.14/src/win32/winconfig.cpp
Examining data/apcupsd-3.14.14/src/win32/winconfig.h
Examining data/apcupsd-3.14.14/src/win32/winevents.cpp
Examining data/apcupsd-3.14.14/src/win32/winevents.h
Examining data/apcupsd-3.14.14/src/win32/winmain.cpp
Examining data/apcupsd-3.14.14/src/win32/winservice.cpp
Examining data/apcupsd-3.14.14/src/win32/winservice.h
Examining data/apcupsd-3.14.14/src/win32/winstat.cpp
Examining data/apcupsd-3.14.14/src/win32/winstat.h
Examining data/apcupsd-3.14.14/src/win32/wintray.cpp
Examining data/apcupsd-3.14.14/src/win32/wintray.h
Examining data/apcupsd-3.14.14/src/win32/winups.h
Examining data/apcupsd-3.14.14/src/action.c
Examining data/apcupsd-3.14.14/src/apcaccess.c

FINAL RESULTS:

data/apcupsd-3.14.14/src/win32/email.c:46:10:  [5] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings. Risk is high; the length parameter
  appears to be a constant, instead of computing the number of characters
  left.
         strncat(addr, argv[i], sizeof(addr));
data/apcupsd-3.14.14/examples/client.c:32:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   fprintf(stderr, msg);
data/apcupsd-3.14.14/examples/client.c:42:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(host, SERV_HOST_ADDR);
data/apcupsd-3.14.14/examples/client.c:46:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(host, argv[1]); /* get host from command line */
data/apcupsd-3.14.14/examples/client.c:61:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(msg, "client: tcp_open for host %s on %d failed\n", host, port);
data/apcupsd-3.14.14/examples/client.c:89:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	 strcpy(sendline, cmd);       /* one shot command */
data/apcupsd-3.14.14/examples/client.c:104:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         sprintf(msg, "handle_client: net_recv error: %s\n", strerror(-n));
data/apcupsd-3.14.14/examples/hid-ups.c:229:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(buf, "/bin/echo %s | /bin/mail -s \"UPS System\" %s", msg, MADDR);
data/apcupsd-3.14.14/examples/hid-ups.c:230:5:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    system(buf);
data/apcupsd-3.14.14/examples/hid-ups.c:315:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(buf, "String index %d returned ERR=%s\n", sindex,
data/apcupsd-3.14.14/examples/hid-ups.c:423:18:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
                 sprintf(evdev, "%s/hiddev%d", hid_dirs[i], j);
data/apcupsd-3.14.14/examples/megaclient.c:44:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   fprintf(stderr, msg);
data/apcupsd-3.14.14/examples/megaclient.c:57:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(host, SERV_HOST_ADDR);
data/apcupsd-3.14.14/examples/megaclient.c:61:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(host, argv[1]); /* get host from command line */
data/apcupsd-3.14.14/examples/megaclient.c:80:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         sprintf(msg, "client: tcp_open for host %s on %d failed\n", host, port);
data/apcupsd-3.14.14/examples/megaclient.c:95:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         sprintf(msg, "handle_client: net_recv error: %s\n", strerror(-n));
data/apcupsd-3.14.14/examples/megaclient.c:108:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(msg, "client: tcp_open for host %s on %d failed\n", host, port);
data/apcupsd-3.14.14/examples/megaclient.c:125:10:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         sprintf(msg, "handle_client: net_recv error: %s\n", strerror(-n));
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:97:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   fprintf(stdout, msg);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:117:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy (sStatus, S_NAGIOS_UNKNOWN);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:119:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(host, SERV_HOST_ADDR);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:123:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(host, argv[1]); /* get host from command line */
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:135:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(hostname, msg);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:141:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(model, msg);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:147:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(upsname, msg);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:158:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_OK);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:163:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_OK);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:168:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_OK);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:173:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_OK);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:178:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_WARNING);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:183:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_CRITICAL);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:188:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_CRITICAL);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:193:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_WARNING);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:198:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_CRITICAL);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:203:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_OK);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:208:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(sStatus, S_NAGIOS_OK);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:219:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(loadpct, msg);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:225:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(runtime, msg);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:288:18:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
                 sscanf (find, "%*s %*s %s", answer);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:326:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
      strcat(statbuf, buf);
data/apcupsd-3.14.14/examples/newslave.c:86:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   fprintf(stderr, msg);
data/apcupsd-3.14.14/examples/newslave.c:100:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(host, SERV_HOST_ADDR);
data/apcupsd-3.14.14/examples/newslave.c:104:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(host, argv[1]); /* get host from command line */
data/apcupsd-3.14.14/examples/newslave.c:116:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(hostname, msg);
data/apcupsd-3.14.14/examples/newslave.c:122:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(release, msg);
data/apcupsd-3.14.14/examples/newslave.c:128:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(upsname, msg);
data/apcupsd-3.14.14/examples/newslave.c:134:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(status, msg);
data/apcupsd-3.14.14/examples/newslave.c:196:18:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
                 sscanf (find, "%*s %*s %s", answer);
data/apcupsd-3.14.14/examples/newslave.c:234:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
      strcat(statbuf, buf);
data/apcupsd-3.14.14/examples/smartsim.c:107:7:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      printf(str, ## args);   \
data/apcupsd-3.14.14/examples/upsapm.c:78:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   fprintf(stderr, msg);
data/apcupsd-3.14.14/examples/upsapm.c:91:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(host, SERV_HOST_ADDR);
data/apcupsd-3.14.14/examples/upsapm.c:95:7:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy(host, argv[1]); /* get host from command line */
data/apcupsd-3.14.14/examples/upsapm.c:192:18:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
                 sscanf (find, "%*s %*s %s", answer);
data/apcupsd-3.14.14/examples/upsapm.c:230:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
      strcat(statbuf, buf);
data/apcupsd-3.14.14/src/cgi/cgilib.c:89:13:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
            sscanf (buf, "%*s %s", addr);
data/apcupsd-3.14.14/src/cgi/multimon.c:580:17:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
            if (sscanf(buf, "MONITOR %s %n", addr, &restofs) == 1) {
data/apcupsd-3.14.14/src/cgi/upsfetch.c:232:18:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
                 sscanf (find, "%*s %*s %s", answer);
data/apcupsd-3.14.14/src/drivers/modbus/modbus.cpp:641:8:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   if (strcpy.len() > len)
data/apcupsd-3.14.14/src/drivers/modbus/modbus.cpp:644:16:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      strcpy = strcpy.substr(0, len);
data/apcupsd-3.14.14/src/drivers/modbus/modbus.cpp:649:14:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
      while (strcpy.len() < len)
data/apcupsd-3.14.14/src/drivers/modbus/modbus.cpp:653:69:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   return _comm->WriteRegister(reg.addr, reg.nregs, (const uint8_t*)strcpy.str());
data/apcupsd-3.14.14/src/drivers/net/net.c:172:13:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
            sscanf(find, format, answer);
data/apcupsd-3.14.14/src/gapcmon/gethostname.c:74:24:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
#warning WARNING! Your system does not have a thread-safe DNS resolver (gethostbyname_r)!
data/apcupsd-3.14.14/src/lib/apcconfig.c:239:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
   if (!sscanf(v, "%s", x))
data/apcupsd-3.14.14/src/lib/apcconfig.c:288:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
   if (!sscanf(v, "%s", x))
data/apcupsd-3.14.14/src/lib/apcconfig.c:367:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
   if (!sscanf(v, "%s", x))
data/apcupsd-3.14.14/src/lib/apcexec.c:208:7:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      execv(apccontrol, (char **)argv);
data/apcupsd-3.14.14/src/lib/apclog.c:106:10:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
         vfprintf(trace_fd, fmt, arg_ptr);
data/apcupsd-3.14.14/src/lib/apclog.c:113:7:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      vfprintf(stdout, fmt, arg_ptr);
data/apcupsd-3.14.14/src/lib/apcstatus.c:412:4:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
   vfprintf(stdout, (char *)fmt, arg_ptr);
data/apcupsd-3.14.14/src/lib/astring.cpp:48:14:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
   int len = vsnprintf(NULL, 0, format, args);
data/apcupsd-3.14.14/src/lib/astring.cpp:61:4:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
   vsnprintf(_data, _len+1, format, args);
data/apcupsd-3.14.14/src/lib/astring.cpp:114:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
      strcat(_data, rhs);
data/apcupsd-3.14.14/src/lib/asys.c:41:10:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
   len = vsnprintf(str, size, fmt, arg_ptr);
data/apcupsd-3.14.14/src/lib/asys.c:56:10:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
   len = vsprintf(buf, fmt, arg_ptr);
data/apcupsd-3.14.14/src/lib/asys.c:76:10:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
   len = vsnprintf(str, size, format, ap);
data/apcupsd-3.14.14/src/lib/asys.c:88:10:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
   len = vsprintf(buf, format, ap);
data/apcupsd-3.14.14/src/smtp.c:141:7:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      vfprintf(stdout, fmt, ap);
data/apcupsd-3.14.14/src/win32/compat/syslog.c:26:6:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
void syslog(int type, const char *fmt, ...)
data/apcupsd-3.14.14/src/win32/compat/syslog.c:37:4:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
   vsnprintf(message+2, sizeof(message)-2, fmt, arg_ptr);
data/apcupsd-3.14.14/src/win32/compat/syslog.h:31:6:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
void syslog(int type, const char *fmt, ...);
data/apcupsd-3.14.14/src/win32/compat/winapi.c:160:40:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
BOOL GrantAccess(HANDLE h, ACCESS_MASK access, TRUSTEE_TYPE type, LPTSTR name)
data/apcupsd-3.14.14/src/win32/compat/winapi.c:174:30:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
   ea.grfAccessPermissions = access;
data/apcupsd-3.14.14/src/win32/compat/winapi.h:102:40:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
BOOL GrantAccess(HANDLE h, ACCESS_MASK access, TRUSTEE_TYPE type, LPTSTR name);
data/apcupsd-3.14.14/src/win32/email.c:61:7:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      printf(buf);
data/apcupsd-3.14.14/src/win32/winservice.cpp:197:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(servicecmd, "\"%s\" %s", path, ApcupsdRunService);
data/apcupsd-3.14.14/include/getopt.h:98:12:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
extern int getopt(int argc, char *const *argv, const char *shortopts);
data/apcupsd-3.14.14/include/getopt.h:99:12:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
data/apcupsd-3.14.14/include/getopt.h:111:12:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
extern int getopt ();
data/apcupsd-3.14.14/include/getopt.h:112:12:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
extern int getopt_long ();
data/apcupsd-3.14.14/src/apcaccess.c:148:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
   while ((ch = getopt(argc, argv, "f:h:p:u")) != -1)
data/apcupsd-3.14.14/src/cgi/cgilib.c:39:17:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        query = getenv ("QUERY_STRING");
data/apcupsd-3.14.14/src/cgi/cgilib.c:151:23:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    server_protocol = getenv("SERVER_PROTOCOL");
data/apcupsd-3.14.14/src/lib/apcexec.c:100:14:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
   comspec = getenv("COMSPEC");
data/apcupsd-3.14.14/src/lib/getopt.c:294:21:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  posixly_correct = getenv ("POSIXLY_CORRECT");
data/apcupsd-3.14.14/src/lib/getopt.c:673:1:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
getopt (int argc, char *const *argv, const char *optstring)
data/apcupsd-3.14.14/src/lib/getopt.c:698:11:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
      c = getopt (argc, argv, "abc:d:0123456789");
data/apcupsd-3.14.14/src/lib/getopt1.c:51:7:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
char *getenv ();
data/apcupsd-3.14.14/src/lib/getopt1.c:59:1:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
getopt_long (int argc, char *const *argv, const char *options,
data/apcupsd-3.14.14/src/lib/getopt1.c:105:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
      c = getopt_long (argc, argv, "abc:d:0123456789",
data/apcupsd-3.14.14/src/options.c:107:16:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
          (c = getopt_long(argc, argv, shortoptions,
data/apcupsd-3.14.14/src/smtp.c:182:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
   while ((ch = getopt(argc, argv, "c:d:f:h:r:s:?")) != -1) {
data/apcupsd-3.14.14/src/smtp.c:237:17:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
      if ((cp = getenv("SMTPSERVER")) != NULL)
data/apcupsd-3.14.14/src/win32/background.c:20:9:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
   rc = CreateProcess(NULL,
data/apcupsd-3.14.14/src/win32/background.c:20:9:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
   rc = CreateProcess(NULL,
data/apcupsd-3.14.14/src/win32/compat/winusb.h:77:9:  [3] (misc) LoadLibrary:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
    h = LoadLibrary(#dll);                                    \
data/apcupsd-3.14.14/src/win32/shutdown.c:30:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
   while ((ch = getopt(argc, argv, "+chrf")) != -1) {
data/apcupsd-3.14.14/src/win32/winservice.cpp:59:19:  [3] (misc) LoadLibrary:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
      kerneldll = LoadLibrary("KERNEL32.DLL");
data/apcupsd-3.14.14/src/win32/winservice.cpp:503:21:  [3] (misc) LoadLibrary:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
   HINSTANCE hLib = LoadLibrary("ADVAPI32.DLL");
data/apcupsd-3.14.14/examples/client.c:39:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char host[200];
data/apcupsd-3.14.14/examples/client.c:40:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char msg[200], *p, *cmd;
data/apcupsd-3.14.14/examples/client.c:50:10:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	 port = atoi(p);
data/apcupsd-3.14.14/examples/client.c:83:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char sendline[MAXLINE];
data/apcupsd-3.14.14/examples/client.c:84:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char recvline[MAXLINE+1];
data/apcupsd-3.14.14/examples/client.c:103:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	 char msg[200];
data/apcupsd-3.14.14/examples/hid-set.c:61:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char evdev[20];
data/apcupsd-3.14.14/examples/hid-set.c:63:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(evdev, "/dev/usb/hid/hiddev%d", i);
data/apcupsd-3.14.14/examples/hid-set.c:64:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(evdev, O_RDONLY)) >= 0) {
data/apcupsd-3.14.14/examples/hid-ups.c:221:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char unknown[24];
data/apcupsd-3.14.14/examples/hid-ups.c:227:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[256];
data/apcupsd-3.14.14/examples/hid-ups.c:245:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(unknown, "[%06x]", detail);
data/apcupsd-3.14.14/examples/hid-ups.c:259:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf(unknown, "[%06x]", detail);
data/apcupsd-3.14.14/examples/hid-ups.c:274:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((fd = open(PWRSTAT, O_CREAT|O_WRONLY, 0644)) >= 0) {
data/apcupsd-3.14.14/examples/hid-ups.c:308:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char buf[200];
data/apcupsd-3.14.14/examples/hid-ups.c:327:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static char buf[200];
data/apcupsd-3.14.14/examples/hid-ups.c:354:12:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
           sprintf(buf, "Volts with %d exponent", exponent);
data/apcupsd-3.14.14/examples/hid-ups.c:363:12:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
           sprintf(buf, "Amps with %d exponent", exponent);
data/apcupsd-3.14.14/examples/hid-ups.c:372:12:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
           sprintf(buf, "Hertz with %d exponent", exponent);
data/apcupsd-3.14.14/examples/hid-ups.c:379:12:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
           sprintf(buf, "Seconds with %d exponent", exponent);
data/apcupsd-3.14.14/examples/hid-ups.c:388:12:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
           sprintf(buf, "Degrees K with %d exponent", exponent);
data/apcupsd-3.14.14/examples/hid-ups.c:396:9:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
        sprintf(buf, "0x%x", unit);
data/apcupsd-3.14.14/examples/hid-ups.c:402:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char evdev[50];
data/apcupsd-3.14.14/examples/hid-ups.c:412:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char name[256] = "Unknown";
data/apcupsd-3.14.14/examples/hid-ups.c:424:28:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
                 if ((fd = open(evdev, O_RDONLY)) < 0) {
data/apcupsd-3.14.14/examples/hid-ups.c:442:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
        if ((fd = open(evdev, O_RDONLY)) < 0) {
data/apcupsd-3.14.14/examples/hid-ups.c:599:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
            fd = open(evdev, O_RDONLY);
data/apcupsd-3.14.14/examples/hiddev.h:55:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char value[HID_STRING_SIZE];
data/apcupsd-3.14.14/examples/megaclient.c:51:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char host[200];
data/apcupsd-3.14.14/examples/megaclient.c:52:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char msg[200], *p, *cmd;
data/apcupsd-3.14.14/examples/megaclient.c:55:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char recvline[MAXLINE+1];
data/apcupsd-3.14.14/examples/megaclient.c:65:10:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	 port = atoi(p);
data/apcupsd-3.14.14/examples/megaclient.c:94:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	 char msg[200];
data/apcupsd-3.14.14/examples/megaclient.c:124:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	 char msg[200];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:22:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char statbuf[BIGBUF];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:104:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char host[200];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:105:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char msg[200], *p;
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:106:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char hostname[100];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:107:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char model[100];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:108:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char upsname[100];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:109:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char status[1000];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:111:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char sStatus[10];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:112:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char loadpct[100];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:113:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char runtime[100];
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:127:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         port = atoi(p);
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:156:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "CALIBRATION ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:161:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "SMART TRIM ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:166:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "SMART BOOST ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:171:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "ONLINE ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:176:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "ON BATTERY ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:181:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "OVERLOADED ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:186:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "BATTERY LOW ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:191:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "REPLACE BATTERY ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:196:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "COMMUNICATION LOST ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:201:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "SHUTDOWN ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:206:7:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
      strcat(status, "SLAVE ");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:275:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
        strcpy(answer, "N/A");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:302:5:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
    strcpy(answer, "Not found");
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:315:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[1000];
data/apcupsd-3.14.14/examples/newslave.c:23:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char statbuf[BIGBUF];
data/apcupsd-3.14.14/examples/newslave.c:93:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char host[200];
data/apcupsd-3.14.14/examples/newslave.c:94:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char msg[200], *p;
data/apcupsd-3.14.14/examples/newslave.c:95:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char hostname[100];
data/apcupsd-3.14.14/examples/newslave.c:96:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char release[100];
data/apcupsd-3.14.14/examples/newslave.c:97:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char upsname[100];
data/apcupsd-3.14.14/examples/newslave.c:98:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char status[100];
data/apcupsd-3.14.14/examples/newslave.c:108:10:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	 port = atoi(p);
data/apcupsd-3.14.14/examples/newslave.c:183:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
        strcpy(answer, "N/A");
data/apcupsd-3.14.14/examples/newslave.c:210:5:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
    strcpy(answer, "Not found");
data/apcupsd-3.14.14/examples/newslave.c:223:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[1000];
data/apcupsd-3.14.14/examples/smartsim.c:207:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[20];
data/apcupsd-3.14.14/examples/smartsim.c:209:4:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
   sprintf(buf, "%03.3f\r\n", *(float*)arg);
data/apcupsd-3.14.14/examples/smartsim.c:215:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[20];
data/apcupsd-3.14.14/examples/smartsim.c:217:4:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
   sprintf(buf, "%02x\r\n", *(unsigned char*)arg);
data/apcupsd-3.14.14/examples/smartsim.c:241:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[20];
data/apcupsd-3.14.14/examples/smartsim.c:243:4:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
   sprintf(buf, "%02x\r\n",
data/apcupsd-3.14.14/examples/smartsim.c:433:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   ups = open(dev, O_RDWR | O_NOCTTY);
data/apcupsd-3.14.14/examples/snoopdecode.c:33:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char line[MAX_LINE] = "";
data/apcupsd-3.14.14/examples/snoopdecode.c:170:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	urb->time = atoi(line+1);
data/apcupsd-3.14.14/examples/snoopdecode.c:179:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	urb->seq = atoi(strstr(line,"URB ")+4);
data/apcupsd-3.14.14/examples/snoopdecode.c:428:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(rpt->data, urb->data+1, rpt->len);
data/apcupsd-3.14.14/examples/snoopdecode.c:436:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[9];
data/apcupsd-3.14.14/examples/snoopdecode.c:453:4:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
			sprintf(buf, "%0*lx", (int)(urb->len-1)*2, data);
data/apcupsd-3.14.14/examples/upsapm.c:45:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char statbuf[BIGBUF];
data/apcupsd-3.14.14/examples/upsapm.c:85:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char host[200];
data/apcupsd-3.14.14/examples/upsapm.c:86:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char msg[200], *p;
data/apcupsd-3.14.14/examples/upsapm.c:99:10:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	 port = atoi(p);
data/apcupsd-3.14.14/examples/upsapm.c:179:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
        strcpy(answer, "N/A");
data/apcupsd-3.14.14/examples/upsapm.c:206:5:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
    strcpy(answer, "Not found");
data/apcupsd-3.14.14/examples/upsapm.c:219:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[1000];
data/apcupsd-3.14.14/include/extern.h:31:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern char argvalue[MAXSTRING];
data/apcupsd-3.14.14/include/extern.h:98:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern char APCCONF[APC_FILENAME_MAX];
data/apcupsd-3.14.14/include/statmgr.h:46:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   bool open();
data/apcupsd-3.14.14/include/statmgr.h:59:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char data[MAX_DATA];
data/apcupsd-3.14.14/include/struct.h:134:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char name[MAXSTRING];           /* JHNC: name mustn't contain whitespace */
data/apcupsd-3.14.14/include/struct.h:135:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char long_name[MAXSTRING];
data/apcupsd-3.14.14/include/struct.h:232:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char UPS_Cap[CI_MAXCI + 1];          /* TRUE if UPS has capability */
data/apcupsd-3.14.14/include/struct.h:266:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char linequal[8];               /* Line quality */
data/apcupsd-3.14.14/include/struct.h:309:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char birth[20];                 /* manufacture date */
data/apcupsd-3.14.14/include/struct.h:310:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char serial[32];                /* serial number */
data/apcupsd-3.14.14/include/struct.h:311:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char battdat[20];               /* battery installation date */
data/apcupsd-3.14.14/include/struct.h:312:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char selftest[9];               /* selftest interval as ASCII */
data/apcupsd-3.14.14/include/struct.h:313:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char firmrev[20];               /* firmware revision */
data/apcupsd-3.14.14/include/struct.h:314:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char upsname[UPSNAMELEN];       /* UPS internal name */
data/apcupsd-3.14.14/include/struct.h:315:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char upsmodel[MAXSTRING];       /* ups model number */
data/apcupsd-3.14.14/include/struct.h:316:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char sensitivity[8];            /* sensitivity to line fluxuations */
data/apcupsd-3.14.14/include/struct.h:317:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char beepstate[8];              /* when to beep on power failure. */
data/apcupsd-3.14.14/include/struct.h:318:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char eprom[500];                /* Eprom values */
data/apcupsd-3.14.14/include/struct.h:334:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char nisip[64];                 /* IP for NIS */
data/apcupsd-3.14.14/include/struct.h:338:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char device[MAXSTRING];         /* device name in use */
data/apcupsd-3.14.14/include/struct.h:339:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char configfile[APC_FILENAME_MAX];   /* config filename */
data/apcupsd-3.14.14/include/struct.h:340:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char statfile[APC_FILENAME_MAX];     /* status filename */
data/apcupsd-3.14.14/include/struct.h:341:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char eventfile[APC_FILENAME_MAX];    /* temp events file */
data/apcupsd-3.14.14/include/struct.h:345:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char master_name[APC_FILENAME_MAX];
data/apcupsd-3.14.14/include/struct.h:346:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char lockpath[APC_FILENAME_MAX];
data/apcupsd-3.14.14/include/struct.h:349:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char scriptdir[APC_FILENAME_MAX];    /* Path to apccontrol dir */
data/apcupsd-3.14.14/include/struct.h:350:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char pwrfailpath[APC_FILENAME_MAX];  /* Path to powerfail flag file dir */
data/apcupsd-3.14.14/include/struct.h:351:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char nologinpath[APC_FILENAME_MAX];  /* Path to nologin dir */
data/apcupsd-3.14.14/src/action.c:184:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
       ((lgnfd = open(ups->nologinpath, O_CREAT | O_WRONLY | O_CLOEXEC, 0644)) >= 0)) {
data/apcupsd-3.14.14/src/apcaccess.c:49:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char recvline[MAXSTRING + 1];
data/apcupsd-3.14.14/src/apcaccess.c:178:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if ((cfg = fopen(cfgfile, "r")))
data/apcupsd-3.14.14/src/apcaccess.c:212:14:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      port = atoi(p);
data/apcupsd-3.14.14/src/apcnis.c:32:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char largebuf[4096];
data/apcupsd-3.14.14/src/apcnis.c:63:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[MAXSTRING];
data/apcupsd-3.14.14/src/apcnis.c:106:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[MAXSTRING];
data/apcupsd-3.14.14/src/apcnis.c:230:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char line[MAXSTRING];
data/apcupsd-3.14.14/src/apcnis.c:260:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
             (fd = open(ups->eventfile, O_RDONLY|O_CLOEXEC)) == -1 ||
data/apcupsd-3.14.14/src/apctest.c:164:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[3000];
data/apcupsd-3.14.14/src/apctest.c:181:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      out_fd = open("apctest.output", O_WRONLY | O_CREAT | O_APPEND | O_CLOEXEC, 0644);
data/apcupsd-3.14.14/src/apctest.c:193:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char dt[MAXSTRING];
data/apcupsd-3.14.14/src/apctest.c:249:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[256];
data/apcupsd-3.14.14/src/apctest.c:341:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char ans[20];
data/apcupsd-3.14.14/src/apctest.c:379:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[200];
data/apcupsd-3.14.14/src/apctest.c:432:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         int item = atoi(cmd);
data/apcupsd-3.14.14/src/apctest.c:744:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         int item = atoi(cmd);
data/apcupsd-3.14.14/src/apctest.c:892:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char answer[2000];
data/apcupsd-3.14.14/src/apctest.c:929:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      int rt = atoi(ans);
data/apcupsd-3.14.14/src/apctest.c:997:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         int rt = atoi(ans);
data/apcupsd-3.14.14/src/apctest.c:1099:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
               int rt = atoi(ans);
data/apcupsd-3.14.14/src/apctest.c:1133:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
               int rt = atoi(ans);
data/apcupsd-3.14.14/src/apctest.c:1179:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         int item = atoi(cmd);
data/apcupsd-3.14.14/src/apctest.c:1283:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char answer[2000];
data/apcupsd-3.14.14/src/apctest.c:1284:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char parts[2000];
data/apcupsd-3.14.14/src/apctest.c:1504:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         int item = atoi(cmd);
data/apcupsd-3.14.14/src/apctest.c:1590:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      newval = atoi(cmd);
data/apcupsd-3.14.14/src/apctest.c:2250:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static char cmd[1000];
data/apcupsd-3.14.14/src/apctest.c:2287:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char cmdvals[50];
data/apcupsd-3.14.14/src/apctest.c:2324:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char val[100];;
data/apcupsd-3.14.14/src/apctest.c:2328:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(&eeprom_ups, ups, sizeof(UPSINFO));
data/apcupsd-3.14.14/src/apctest.c:2338:51:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
               asnprintf(val, sizeof(val), "%s", (char *)cmd_table[j].data);
data/apcupsd-3.14.14/src/apctest.c:2488:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         int item = atoi(cmd);
data/apcupsd-3.14.14/src/apctest.c:2827:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char str[11];
data/apcupsd-3.14.14/src/apctest.c:2867:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char str[11];
data/apcupsd-3.14.14/src/apcupsd.c:87:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[256];
data/apcupsd-3.14.14/src/apcupsd.c:131:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   tmp_fd = open("/dev/null", O_RDONLY);
data/apcupsd-3.14.14/src/apcupsd.c:211:23:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      ups->event_fd = open(ups->eventfile, O_RDWR | O_CREAT | O_APPEND | O_CLOEXEC, 0644);
data/apcupsd-3.14.14/src/apcupsd.c:335:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   fd = open("/dev/null", O_RDONLY);
data/apcupsd-3.14.14/src/cgi/cgilib.c:79:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char    fn[256], buf[500], addr[256];
data/apcupsd-3.14.14/src/cgi/cgilib.c:82:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    hostlist = fopen(fn, "r");
data/apcupsd-3.14.14/src/cgi/cgilib.c:149:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char fn[256], buf[500];
data/apcupsd-3.14.14/src/cgi/cgilib.c:202:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    hostlist = fopen(fn, "r");
data/apcupsd-3.14.14/src/cgi/multimon.c:110:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        refresh = atoi(value);
data/apcupsd-3.14.14/src/cgi/multimon.c:127:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char    model[256];
data/apcupsd-3.14.14/src/cgi/multimon.c:151:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char    status[64], *stat, stattxt[128], temp[128];
data/apcupsd-3.14.14/src/cgi/multimon.c:167:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "CAL ");
data/apcupsd-3.14.14/src/cgi/multimon.c:169:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "TRIM ");
data/apcupsd-3.14.14/src/cgi/multimon.c:171:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "BOOST ");
data/apcupsd-3.14.14/src/cgi/multimon.c:173:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "OL ");
data/apcupsd-3.14.14/src/cgi/multimon.c:175:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "OB ");
data/apcupsd-3.14.14/src/cgi/multimon.c:177:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "OVER ");
data/apcupsd-3.14.14/src/cgi/multimon.c:179:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "LB ");
data/apcupsd-3.14.14/src/cgi/multimon.c:181:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "RB ");
data/apcupsd-3.14.14/src/cgi/multimon.c:183:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "NB ");
data/apcupsd-3.14.14/src/cgi/multimon.c:185:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "CL ");
data/apcupsd-3.14.14/src/cgi/multimon.c:187:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "SD ");
data/apcupsd-3.14.14/src/cgi/multimon.c:189:8:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
       strcat(status, "SLAVE ");
data/apcupsd-3.14.14/src/cgi/multimon.c:233:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char    upstemp[64];
data/apcupsd-3.14.14/src/cgi/multimon.c:246:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char    upstemp[64];
data/apcupsd-3.14.14/src/cgi/multimon.c:272:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char        humidity[64];
data/apcupsd-3.14.14/src/cgi/multimon.c:287:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char    ambtemp[64];
data/apcupsd-3.14.14/src/cgi/multimon.c:300:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char    ambtemp[64];
data/apcupsd-3.14.14/src/cgi/multimon.c:326:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char utility[64], lowxfer[64], highxfer[64];
data/apcupsd-3.14.14/src/cgi/multimon.c:335:20:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            lowx = atoi(lowxfer);
data/apcupsd-3.14.14/src/cgi/multimon.c:337:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            highx = atoi(highxfer);
data/apcupsd-3.14.14/src/cgi/multimon.c:343:20:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            util = atoi(utility);
data/apcupsd-3.14.14/src/cgi/multimon.c:364:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char    tmpbuf[256];
data/apcupsd-3.14.14/src/cgi/multimon.c:499:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char    buf[512], fn[MAXPATHLEN];
data/apcupsd-3.14.14/src/cgi/multimon.c:502:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    conf = fopen (fn, "r");
data/apcupsd-3.14.14/src/cgi/multimon.c:541:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char    buf[256], fn[MAXPATHLEN], addr[256], timestr[256];
data/apcupsd-3.14.14/src/cgi/multimon.c:574:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    conf = fopen (fn, "r");
data/apcupsd-3.14.14/src/cgi/upsfetch.c:32:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char statbuf[4096];
data/apcupsd-3.14.14/src/cgi/upsfetch.c:35:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char last_host[256] = "";
data/apcupsd-3.14.14/src/cgi/upsfetch.c:36:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char errmsg[200] = "";
data/apcupsd-3.14.14/src/cgi/upsfetch.c:103:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char lhost[200];
data/apcupsd-3.14.14/src/cgi/upsfetch.c:115:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      nis_port = atoi(p);
data/apcupsd-3.14.14/src/cgi/upsfetch.c:140:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[500];
data/apcupsd-3.14.14/src/cgi/upsfetch.c:144:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char lhost[200];
data/apcupsd-3.14.14/src/cgi/upsfetch.c:154:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      nis_port = atoi(p);
data/apcupsd-3.14.14/src/cgi/upsfetch.c:184:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(statbuf, buf, len);
data/apcupsd-3.14.14/src/cgi/upsfetch.c:258:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[1000];
data/apcupsd-3.14.14/src/cgi/upsfetch.h:25:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern char statbuf[4096];
data/apcupsd-3.14.14/src/cgi/upsfetch.h:27:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
extern char errmsg[200];
data/apcupsd-3.14.14/src/cgi/upsfstats.c:26:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char   monhost[MAXHOSTNAMELEN] = "127.0.0.1";
data/apcupsd-3.14.14/src/cgi/upsfstats.c:36:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        refresh = atoi(value);
data/apcupsd-3.14.14/src/cgi/upsfstats.c:45:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char   answer[256];
data/apcupsd-3.14.14/src/cgi/upsimage.c:41:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char    mycmd[16] = "";
data/apcupsd-3.14.14/src/cgi/upsimage.c:42:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char    upsval[16] = "";
data/apcupsd-3.14.14/src/cgi/upsimage.c:43:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char    upsval2[16] = "";
data/apcupsd-3.14.14/src/cgi/upsimage.c:44:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char    upsval3[16] = "";
data/apcupsd-3.14.14/src/cgi/upsimage.c:70:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char text[10];
data/apcupsd-3.14.14/src/cgi/upsimage.c:161:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char	   batttxt[16];
data/apcupsd-3.14.14/src/cgi/upsimage.c:189:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char	   batttxt[16];
data/apcupsd-3.14.14/src/cgi/upsimage.c:281:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char	   loadtxt[16];
data/apcupsd-3.14.14/src/cgi/upsimage.c:309:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char	   utiltxt[16];
data/apcupsd-3.14.14/src/cgi/upsimage.c:356:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char	   utiltxt[16];
data/apcupsd-3.14.14/src/cgi/upsimage.c:393:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char	   utiltxt[16];
data/apcupsd-3.14.14/src/cgi/upsstats.c:47:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char   monhost[MAXHOSTNAMELEN] = "127.0.0.1";
data/apcupsd-3.14.14/src/cgi/upsstats.c:51:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char   temps[16] = "C";
data/apcupsd-3.14.14/src/cgi/upsstats.c:61:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        img1 = atoi(value);
data/apcupsd-3.14.14/src/cgi/upsstats.c:67:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        img2 = atoi(value);
data/apcupsd-3.14.14/src/cgi/upsstats.c:73:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        img3 = atoi(value);
data/apcupsd-3.14.14/src/cgi/upsstats.c:83:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        refresh = atoi(value);
data/apcupsd-3.14.14/src/cgi/upsstats.c:92:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char   answer[256], answer2[256], answer3[256];
data/apcupsd-3.14.14/src/cgi/upsstats.c:176:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char   answer[256];
data/apcupsd-3.14.14/src/device.c:81:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   pwdf = open(ups->pwrfailpath, O_RDONLY|O_CLOEXEC);
data/apcupsd-3.14.14/src/drivers/apcsmart/smart.c:141:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static char answer[2000];
data/apcupsd-3.14.14/src/drivers/apcsmart/smart.c:437:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char status[10];
data/apcupsd-3.14.14/src/drivers/apcsmart/smart.c:790:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char ans[20];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:32:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char setting[20];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:84:59:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         asnprintf(setting, sizeof(setting), "%02d", (int)atoi(data));
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:97:59:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         asnprintf(setting, sizeof(setting), "%03d", (int)atoi(data));
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:110:59:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         asnprintf(setting, sizeof(setting), "%03d", (int)atoi(data));
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:122:59:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         asnprintf(setting, sizeof(setting), "%03d", (int)atoi(data));
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:135:59:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         asnprintf(setting, sizeof(setting), "%03d", (int)atoi(data));
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:148:59:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         asnprintf(setting, sizeof(setting), "%02d", (int)atoi(data));
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:179:59:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         asnprintf(setting, sizeof(setting), "%03d", (int)atoi(data));
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:216:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char response[32];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:217:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char name[10];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:276:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char response[32];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:277:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char battdat[9];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:326:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char response[32];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:327:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char response1[32];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:328:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char oldvalue[32];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:329:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char lastvalue[32];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:330:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char allvalues[256];
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:427:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char setting[20];
data/apcupsd-3.14.14/src/drivers/apcsmart/smartoper.c:32:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char response[32] = {0};
data/apcupsd-3.14.14/src/drivers/apcsmart/smartoper.c:91:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char response[32];
data/apcupsd-3.14.14/src/drivers/apcsmart/smartoper.c:128:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char response[32];
data/apcupsd-3.14.14/src/drivers/apcsmart/smartsetup.c:47:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char device[MAXSTRING];
data/apcupsd-3.14.14/src/drivers/apcsmart/smartsetup.c:55:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if ((_ups->fd = open(opendev, O_RDWR | O_NOCTTY | O_NDELAY | O_BINARY | O_CLOEXEC)) < 0)
data/apcupsd-3.14.14/src/drivers/apcsmart/smartsetup.c:143:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char answer[10];
data/apcupsd-3.14.14/src/drivers/apcsmart/smartsetup2.c:93:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char answer[1000];              /* keep this big to handle big string */
data/apcupsd-3.14.14/src/drivers/apcsmart/smartsetup2.c:94:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char caps[1000], *cmds, *p;
data/apcupsd-3.14.14/src/drivers/dumb/dumbsetup.c:49:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char device[MAXSTRING];
data/apcupsd-3.14.14/src/drivers/dumb/dumbsetup.c:56:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if ((_ups->fd = open(opendev, O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC)) < 0)
data/apcupsd-3.14.14/src/drivers/modbus/ModbusComm.cpp:75:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(ret, rxpdu+1, nbytes);
data/apcupsd-3.14.14/src/drivers/modbus/ModbusComm.cpp:98:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(txpdu+5, data, nbytes);
data/apcupsd-3.14.14/src/drivers/modbus/ModbusComm.cpp:136:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(txfrm+2, txpdu, txsz);
data/apcupsd-3.14.14/src/drivers/modbus/ModbusComm.cpp:206:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(rxpdu, rxfrm+2, rxsz);
data/apcupsd-3.14.14/src/drivers/modbus/ModbusRs232Comm.cpp:61:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char device[MAXSTRING];
data/apcupsd-3.14.14/src/drivers/modbus/ModbusRs232Comm.cpp:68:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if ((_fd = open(path, O_RDWR | O_NOCTTY | O_NDELAY | O_BINARY | O_CLOEXEC)) < 0)
data/apcupsd-3.14.14/src/drivers/modbus/ModbusUsbComm.cpp:112:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(rpt+1, frm, sz-2);
data/apcupsd-3.14.14/src/drivers/modbus/ModbusUsbComm.cpp:207:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(frm, rpt+1, frmsz);
data/apcupsd-3.14.14/src/drivers/net/net.c:159:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char format[21];
data/apcupsd-3.14.14/src/drivers/net/net.c:199:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[1000];
data/apcupsd-3.14.14/src/drivers/net/net.c:294:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char answer[200];
data/apcupsd-3.14.14/src/drivers/net/net.c:393:15:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      _port = atoi(cp);
data/apcupsd-3.14.14/src/drivers/net/net.c:418:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char answer[200];
data/apcupsd-3.14.14/src/drivers/net/net.c:475:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char answer[200];
data/apcupsd-3.14.14/src/drivers/net/net.c:547:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char answer[200];
data/apcupsd-3.14.14/src/drivers/net/net.c:600:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char answer[200];
data/apcupsd-3.14.14/src/drivers/net/net.h:64:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char _device[MAXSTRING];
data/apcupsd-3.14.14/src/drivers/net/net.h:71:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char _statbuf[BIGBUF];
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:348:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static char ascii[33];
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:349:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char byte[3];
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:516:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[4096];
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:645:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         port = atoi(ptr);
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:787:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char data[1024];
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.h:41:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char _device[MAXSTRING];             /* Copy of ups->device */
data/apcupsd-3.14.14/src/drivers/snmplite/asn.cpp:355:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(buffer, _data, _len);
data/apcupsd-3.14.14/src/drivers/snmplite/asn.cpp:383:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(_data, data, len);
data/apcupsd-3.14.14/src/drivers/snmplite/asn.cpp:436:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(_value, oid, _count*sizeof(int));
data/apcupsd-3.14.14/src/drivers/snmplite/asn.cpp:714:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(tmp, _data, _size * sizeof(_data[0]));
data/apcupsd-3.14.14/src/drivers/snmplite/snmp.cpp:325:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char data[8192];
data/apcupsd-3.14.14/src/drivers/snmplite/snmp.cpp:346:20:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static unsigned char data[8192];
data/apcupsd-3.14.14/src/drivers/snmplite/snmplite.cpp:124:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         _port = atoi(cp);
data/apcupsd-3.14.14/src/drivers/snmplite/snmplite.h:66:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char _device[MAXSTRING];       /* Copy of ups->device */
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:84:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char intdevname[USB_MAX_DEVNAMELEN + 5 + 3 + 1];
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:86:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   fd = open(devname, O_RDWR | O_NOCTTY | O_CLOEXEC);
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:144:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   fd = open(intdevname, O_RDONLY | O_NOCTTY | O_CLOEXEC);
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:168:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char devname[USB_MAX_DEVNAMELEN + 5 + 1];
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:219:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      fd = open(busname, O_RDWR | O_NOCTTY | O_CLOEXEC);
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:495:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(uval, &val, sizeof(*uval));
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:505:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char data[20];
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:558:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char buf[100];
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:725:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char rpt[20];
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.h:81:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char _orig_device[MAXSTRING];    /* Original port specification */
data/apcupsd-3.14.14/src/drivers/usb/bsd/hidutils.c:246:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
         memcpy(outitem, &item, sizeof(item));
data/apcupsd-3.14.14/src/drivers/usb/bsd/hidutils.c:350:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static char string[128];
data/apcupsd-3.14.14/src/drivers/usb/generic/generic-usb.c:216:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(uval, &val, sizeof(*uval));
data/apcupsd-3.14.14/src/drivers/usb/generic/generic-usb.c:226:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char data[20];
data/apcupsd-3.14.14/src/drivers/usb/generic/generic-usb.c:348:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char buf[20];
data/apcupsd-3.14.14/src/drivers/usb/generic/generic-usb.c:496:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char rpt[20];
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c:97:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   fd = open(dev, O_RDWR | O_NOCTTY | O_CLOEXEC);
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c:138:16:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      int fd = open(g.gl_pathv[i], O_RDWR|O_CLOEXEC);
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c:202:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char devname[MAXSTRING];
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c:424:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(uval, &val, sizeof(*uval));
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c:740:25:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                        memcpy(&info->uref, &uref, sizeof(uref));
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c:751:25:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
                        memcpy(&info->wuref, &uref, sizeof(uref));
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.h:88:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char _orig_device[MAXSTRING];    /* Original port specification */
data/apcupsd-3.14.14/src/drivers/usb/usb.c:310:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      _ups->UPSLoad = atoi(digits);
data/apcupsd-3.14.14/src/drivers/usb/usb.c:316:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      _ups->lotrans = atoi(digits);
data/apcupsd-3.14.14/src/drivers/usb/usb.c:321:23:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      _ups->hitrans = atoi(digits);
data/apcupsd-3.14.14/src/drivers/usb/usb.c:326:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      _ups->LineFreq = atoi(digits);
data/apcupsd-3.14.14/src/drivers/usb/usb.h:60:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char sValue[MAXSTRING];       /* Value if string */
data/apcupsd-3.14.14/src/gapcmon/eggtrayicon.c:361:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buffer[256];
data/apcupsd-3.14.14/src/gapcmon/eggtrayicon.c:452:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
         memcpy(&ev.data, message, 20);
data/apcupsd-3.14.14/src/gapcmon/eggtrayicon.c:456:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
         memcpy(&ev.data, message, len);
data/apcupsd-3.14.14/src/lib/apcconfig.c:30:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char argvalue[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcconfig.c:36:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char APCCONF[APC_FILENAME_MAX] = SYSCONFDIR APCCONF_FILE;
data/apcupsd-3.14.14/src/lib/apcconfig.c:230:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char x[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcconfig.c:280:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char x[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcconfig.c:320:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char x[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcconfig.c:364:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char x[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcconfig.c:606:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char line[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcconfig.c:611:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if ((fd = open(cfgfile, O_RDONLY|O_CLOEXEC)) == -1 ||
data/apcupsd-3.14.14/src/lib/apcerror.c:49:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[256];
data/apcupsd-3.14.14/src/lib/apcevents.c:122:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char *le[NLE];
data/apcupsd-3.14.14/src/lib/apcexec.c:30:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char *thread_name[MAX_THREADS];
data/apcupsd-3.14.14/src/lib/apcexec.c:81:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char sbindir[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcexec.c:85:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char cmdline[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcexec.c:156:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   const char *argv[6];
data/apcupsd-3.14.14/src/lib/apcexec.c:157:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char connected[20], powered[20];
data/apcupsd-3.14.14/src/lib/apcexec.c:158:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char apccontrol[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcfile.c:43:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if ((makefd = open(path, O_CREAT | O_WRONLY | O_CLOEXEC, 0644)) >= 0) {
data/apcupsd-3.14.14/src/lib/apcfile.c:60:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[100];
data/apcupsd-3.14.14/src/lib/apcfile.c:63:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if ((pfd = open(pidfile, O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC, 0644)) >= 0) {
data/apcupsd-3.14.14/src/lib/apclock.c:43:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char pidbuffer[12];
data/apcupsd-3.14.14/src/lib/apclock.c:65:25:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if ((ups->lockfile = open(ups->lockpath, O_RDONLY|O_CLOEXEC)) < 0) {
data/apcupsd-3.14.14/src/lib/apclock.c:157:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char pidbuffer[12];
data/apcupsd-3.14.14/src/lib/apclock.c:190:25:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if ((ups->lockfile = open(ups->lockpath, O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, 0644)) < 0) {
data/apcupsd-3.14.14/src/lib/apclog.c:51:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char msg[2 *MAXSTRING];
data/apcupsd-3.14.14/src/lib/apclog.c:52:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char datetime[100];
data/apcupsd-3.14.14/src/lib/apclog.c:99:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
         char fn[200];
data/apcupsd-3.14.14/src/lib/apclog.c:101:19:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
         int fd = open(fn, O_RDWR|O_APPEND|O_CREAT|O_CLOEXEC, 0666);
data/apcupsd-3.14.14/src/lib/apclog.c:124:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[4096];
data/apcupsd-3.14.14/src/lib/apclog.c:167:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[4];
data/apcupsd-3.14.14/src/lib/apclog.c:176:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char line[8+2+16*3+1+16+1];
data/apcupsd-3.14.14/src/lib/apcstatus.c:33:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char datetime[100];
data/apcupsd-3.14.14/src/lib/apcstatus.c:34:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[MAXSTRING];
data/apcupsd-3.14.14/src/lib/apcstatus.c:37:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char status[100];
data/apcupsd-3.14.14/src/lib/asys.c:62:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(str, buf, size);
data/apcupsd-3.14.14/src/lib/asys.c:92:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy(str, buf, size);
data/apcupsd-3.14.14/src/lib/inet_pton.c:114:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(dst, tmp, NS_INADDRSZ);
data/apcupsd-3.14.14/src/lib/inet_pton.c:211:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(dst, tmp, NS_IN6ADDRSZ);
data/apcupsd-3.14.14/src/lib/localtime_r.c:39:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(tm, ltm, sizeof(struct tm));
data/apcupsd-3.14.14/src/lib/md5.c:169:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		memcpy(xbuf, data, 64);
data/apcupsd-3.14.14/src/lib/md5.c:343:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(pms->buf + offset, p, copy);
data/apcupsd-3.14.14/src/lib/md5.c:357:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(pms->buf, p, left);
data/apcupsd-3.14.14/src/lib/statmgr.cpp:44:42:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      if (m_socket == INVALID_SOCKET && !open()) {
data/apcupsd-3.14.14/src/lib/statmgr.cpp:134:39:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   if (m_socket == INVALID_SOCKET && !open()) {
data/apcupsd-3.14.14/src/lib/statmgr.cpp:147:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char temp[1024];
data/apcupsd-3.14.14/src/lib/statmgr.cpp:196:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
bool StatMgr::open()
data/apcupsd-3.14.14/src/libusbhid/HidUps.cpp:224:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static char string[128];
data/apcupsd-3.14.14/src/libusbhid/HidUps.cpp:366:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
         memcpy(outitem, &item, sizeof(item));
data/apcupsd-3.14.14/src/libusbhid/descr.c:53:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(r->data, data, size);
data/apcupsd-3.14.14/src/libusbhid/usage.c:74:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char line[100], name[100], *p, *n;
data/apcupsd-3.14.14/src/libusbhid/usage.c:82:6:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	f = fopen(hidname, "r");
data/apcupsd-3.14.14/src/libusbhid/usage.c:158:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char b[10];
data/apcupsd-3.14.14/src/libusbhid/usage.c:178:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	static char b[100];
data/apcupsd-3.14.14/src/libusbhid/usbcompat.h:20:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
typedef unsigned char uWord[2];
data/apcupsd-3.14.14/src/libusbhid/usbcompat.h:21:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
typedef unsigned char uDWord[4];
data/apcupsd-3.14.14/src/libusbhid/usbcompat.h:35:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        unsigned char ucrd_data[1024];        /* filled data size will vary */
data/apcupsd-3.14.14/src/libusbhid/usbvar.h:34:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	unsigned char data[1];
data/apcupsd-3.14.14/src/options.c:162:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         debug_level = atoi(optarg);
data/apcupsd-3.14.14/src/options.c:194:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   extern char sbindir[MAXSTRING];
data/apcupsd-3.14.14/src/reports.c:28:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char largebuf[4096];
data/apcupsd-3.14.14/src/reports.c:57:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[MAXSTRING];
data/apcupsd-3.14.14/src/reports.c:104:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[MAXSTRING];
data/apcupsd-3.14.14/src/reports.c:189:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
         if ((fd = open(ups->statfile, O_WRONLY|O_TRUNC|O_CREAT|O_CLOEXEC, 0666)) == -1 ||
data/apcupsd-3.14.14/src/smtp.c:70:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char my_hostname[MAXSTRING];
data/apcupsd-3.14.14/src/smtp.c:73:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char argvalue[MAXSTRING];
data/apcupsd-3.14.14/src/smtp.c:95:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[MAXSTRING];
data/apcupsd-3.14.14/src/smtp.c:116:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static char temp[MAXSTRING];
data/apcupsd-3.14.14/src/smtp.c:171:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[MAXSTRING];
data/apcupsd-3.14.14/src/smtp.c:190:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         debug_level = atoi(optarg);
data/apcupsd-3.14.14/src/smtp.c:205:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            mailport = atoi(p);
data/apcupsd-3.14.14/src/smtp.c:298:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
   memcpy((char *)&sin.sin_addr, hp->h_addr, hp->h_length);
data/apcupsd-3.14.14/src/win32/apctray.cpp:50:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[2048];
data/apcupsd-3.14.14/src/win32/apctray.cpp:62:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[2048];
data/apcupsd-3.14.14/src/win32/apctray.cpp:84:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char path[1024];
data/apcupsd-3.14.14/src/win32/apctray.cpp:88:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char cmd[1024];
data/apcupsd-3.14.14/src/win32/compat/libusb-winusb-bridge.c:291:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   unsigned char temp[MAXIMUM_USB_STRING_LENGTH];
data/apcupsd-3.14.14/src/win32/compat/libusb-winusb-bridge.c:362:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static char buf[256];
data/apcupsd-3.14.14/src/win32/compat/libusb-winusb-bridge.h:67:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char filename[PATH_MAX + 1];
data/apcupsd-3.14.14/src/win32/compat/libusb-winusb-bridge.h:75:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char dirname[PATH_MAX + 1];
data/apcupsd-3.14.14/src/win32/compat/syslog.c:29:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char message[1024];
data/apcupsd-3.14.14/src/win32/email.c:19:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char addr[100];
data/apcupsd-3.14.14/src/win32/email.c:55:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[100];
data/apcupsd-3.14.14/src/win32/instmgr.cpp:65:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char name[128];
data/apcupsd-3.14.14/src/win32/instmgr.cpp:142:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char name[128];
data/apcupsd-3.14.14/src/win32/instmgr.cpp:286:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char path[1024];
data/apcupsd-3.14.14/src/win32/instmgr.cpp:290:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char cmd[1024];
data/apcupsd-3.14.14/src/win32/instmgr.cpp:338:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char data[512]; // Arbitrary max
data/apcupsd-3.14.14/src/win32/listview.cpp:51:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char str[256];
data/apcupsd-3.14.14/src/win32/winabout.cpp:62:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char tmp[128];
data/apcupsd-3.14.14/src/win32/winconfig.cpp:92:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char tmp[256] = {0};
data/apcupsd-3.14.14/src/win32/winconfig.cpp:130:21:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         int port = atoi(tmp);
data/apcupsd-3.14.14/src/win32/winconfig.cpp:135:24:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
         int refresh = atoi(tmp);
data/apcupsd-3.14.14/src/win32/winmain.cpp:50:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char *command_args[MAX_COMMAND_ARGS] = { apcupsd_name, NULL };
data/apcupsd-3.14.14/src/win32/winmain.cpp:52:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static char *winargs[MAX_COMMAND_ARGS];
data/apcupsd-3.14.14/src/win32/winservice.cpp:183:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char path[MAXPATH];
data/apcupsd-3.14.14/src/win32/winservice.cpp:195:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char servicecmd[MAXPATH];
data/apcupsd-3.14.14/src/win32/winservice.cpp:478:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char msgbuff[256];
data/apcupsd-3.14.14/src/win32/winservice.cpp:482:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   const char *strings[3];
data/apcupsd-3.14.14/src/win32/winstat.cpp:184:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
   _bmeter->Set(atoi(statmgr->Get("BCHARGE")));
data/apcupsd-3.14.14/src/win32/winstat.cpp:187:17:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
   _lmeter->Set(atoi(statmgr->Get("LOADPCT")));
data/apcupsd-3.14.14/src/win32/winstat.cpp:190:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char str[128];
data/apcupsd-3.14.14/src/win32/wintray.cpp:62:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char title[1024];
data/apcupsd-3.14.14/src/win32/wintray.cpp:311:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
         char buf[100];
data/apcupsd-3.14.14/examples/client.c:94:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      n = strlen(sendline);
data/apcupsd-3.14.14/examples/hid-ups.c:440:12:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
           strncpy(evdev, argv[argc -1], sizeof(evdev)-1);
data/apcupsd-3.14.14/examples/hid-ups.c:627:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            rd = read(fd, ev, sizeof(ev));
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:211:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (strlen(status) > 0) {
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:212:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      status[strlen(status) - 1] = '\0';
data/apcupsd-3.14.14/examples/nagios_plugin_check_apcupsd.c:331:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   statlen = strlen(statbuf);
data/apcupsd-3.14.14/examples/newslave.c:239:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   statlen = strlen(statbuf);
data/apcupsd-3.14.14/examples/smartsim.c:201:21:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   wups((char*)arg, strlen((char*)arg));
data/apcupsd-3.14.14/examples/smartsim.c:210:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   wups(buf, strlen(buf));
data/apcupsd-3.14.14/examples/smartsim.c:218:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   wups(buf, strlen(buf));
data/apcupsd-3.14.14/examples/smartsim.c:252:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   wups(buf, strlen(buf));
data/apcupsd-3.14.14/examples/smartsim.c:479:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            rc = read(ups, &cmd, 1);
data/apcupsd-3.14.14/examples/smartsim.c:505:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            rc = read(con, &cmd, 1);
data/apcupsd-3.14.14/examples/upsapm.c:235:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   statlen = strlen(statbuf);
data/apcupsd-3.14.14/src/action.c:185:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      write(lgnfd, POWERFAIL, strlen(POWERFAIL));
data/apcupsd-3.14.14/src/apcaccess.c:70:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
         line = recvline + strlen(var) + 1;
data/apcupsd-3.14.14/src/apcaccess.c:82:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            size_t ulen = strlen(u);
data/apcupsd-3.14.14/src/apcaccess.c:83:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            size_t llen = strlen(line);
data/apcupsd-3.14.14/src/apcnis.c:66:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   i = strlen(largebuf);
data/apcupsd-3.14.14/src/apcnis.c:70:31:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (net_send(nsockfd, buf, strlen(buf)) <= 0) {
data/apcupsd-3.14.14/src/apcnis.c:112:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if ((i = (strlen(largebuf) + strlen(buf))) < (int)(sizeof(largebuf) - 1)) {
data/apcupsd-3.14.14/src/apcnis.c:112:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if ((i = (strlen(largebuf) + strlen(buf))) < (int)(sizeof(largebuf) - 1)) {
data/apcupsd-3.14.14/src/apctest.c:187:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   return write(out_fd, buf, strlen(buf));
data/apcupsd-3.14.14/src/apctest.c:254:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   i = strlen(buf);
data/apcupsd-3.14.14/src/apctest.c:512:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   (void)fgetc(stdin);
data/apcupsd-3.14.14/src/apctest.c:527:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   (void)fgetc(stdin);
data/apcupsd-3.14.14/src/apctest.c:542:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   (void)fgetc(stdin);
data/apcupsd-3.14.14/src/apctest.c:570:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   (void)fgetc(stdin);
data/apcupsd-3.14.14/src/apctest.c:617:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   (void)fgetc(stdin);
data/apcupsd-3.14.14/src/apctest.c:657:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   (void)fgetc(stdin);
data/apcupsd-3.14.14/src/apctest.c:812:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (read(ups->fd, &ch, 1) == 1)
data/apcupsd-3.14.14/src/apctest.c:867:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         if (read(0, &ch, 1) != 1)
data/apcupsd-3.14.14/src/apctest.c:876:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         if (read(ups->fd, &ch, 1) != 1)
data/apcupsd-3.14.14/src/apctest.c:1043:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            retval = read(ups->fd, &cmd, 1);
data/apcupsd-3.14.14/src/apctest.c:1067:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            read(STDIN_FILENO, &cmd, 1);
data/apcupsd-3.14.14/src/apctest.c:1073:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            retval = read(ups->fd, &cmd, 1);
data/apcupsd-3.14.14/src/apctest.c:1188:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(cmd) != 8 || cmd[2] != '/' || cmd[5] != '/') {
data/apcupsd-3.14.14/src/apctest.c:1197:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(cmd) == 0 || strlen(cmd) > 8) {
data/apcupsd-3.14.14/src/apctest.c:1197:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(cmd) == 0 || strlen(cmd) > 8) {
data/apcupsd-3.14.14/src/apctest.c:1459:54:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   pmsg("The EPROM string is %d characters long!\n", strlen(ans));
data/apcupsd-3.14.14/src/apctest.c:1787:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   (void)fgetc(stdin);
data/apcupsd-3.14.14/src/apctest.c:2095:17:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         while (fgetc(stdin) != '\n')
data/apcupsd-3.14.14/src/apctest.c:2270:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   p = cmd + strlen(cmd) - 1;
data/apcupsd-3.14.14/src/apctest.c:2404:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(cmd[ncmd].cmdvals, p, n * s);     /* save values */
data/apcupsd-3.14.14/src/apctest.c:2428:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      locale1 = *(ups->firmrev + strlen(ups->firmrev) - 1);
data/apcupsd-3.14.14/src/apctest.c:2433:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      locale2 = *(ups->upsmodel + strlen(ups->upsmodel) - 1);
data/apcupsd-3.14.14/src/apctest.c:2554:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   (void)fgetc(stdin);
data/apcupsd-3.14.14/src/apctest.c:2729:17:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         while (fgetc(stdin) != '\n')
data/apcupsd-3.14.14/src/apcupsd.c:93:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   i = strlen(buf);
data/apcupsd-3.14.14/src/apcupsd.c:325:14:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
   oldmask = umask(022);
data/apcupsd-3.14.14/src/apcupsd.c:327:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
   umask(oldmask);
data/apcupsd-3.14.14/src/cgi/cgilib.c:90:38:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strncmp(addr, check, strlen(check)) == 0) {
data/apcupsd-3.14.14/src/cgi/multimon.c:437:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int len = strlen(buf) + 1;
data/apcupsd-3.14.14/src/cgi/multimon.c:450:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    ptr = buf + strlen(var) + 1;
data/apcupsd-3.14.14/src/cgi/multimon.c:509:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        buf[strlen(buf) - 1] = '\0';
data/apcupsd-3.14.14/src/cgi/upsfetch.c:107:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(last_host, host, sizeof(last_host)); 
data/apcupsd-3.14.14/src/cgi/upsfetch.c:110:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(lhost, host, sizeof(lhost)-1);
data/apcupsd-3.14.14/src/cgi/upsfetch.c:149:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(lhost, host, sizeof(lhost)-1);
data/apcupsd-3.14.14/src/cgi/upsfetch.c:177:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      len = strlen(buf);
data/apcupsd-3.14.14/src/cgi/upsfetch.c:218:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
        strncpy(answer, "N/A", anslen);
data/apcupsd-3.14.14/src/cgi/upsfetch.c:246:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
    strncpy(answer, "Not found", anslen);
data/apcupsd-3.14.14/src/cgi/upsfetch.c:269:7:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
      strncat(statbuf, buf, sizeof(statbuf)-statlen-1);
data/apcupsd-3.14.14/src/cgi/upsfetch.c:270:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      statlen = strlen(statbuf);
data/apcupsd-3.14.14/src/cgi/upsfstats.c:32:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (monhost, value, sizeof(monhost));
data/apcupsd-3.14.14/src/cgi/upsimage.c:114:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	  strncpy (mycmd, value, sizeof(mycmd));
data/apcupsd-3.14.14/src/cgi/upsimage.c:118:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	  strncpy (upsval, value, sizeof(upsval));
data/apcupsd-3.14.14/src/cgi/upsimage.c:122:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	  strncpy (upsval2, value, sizeof(upsval2));
data/apcupsd-3.14.14/src/cgi/upsimage.c:126:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	  strncpy (upsval3, value, sizeof(upsval3));
data/apcupsd-3.14.14/src/cgi/upsstats.c:57:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (monhost, value, sizeof(monhost));
data/apcupsd-3.14.14/src/cgi/upsstats.c:79:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (temps, value, sizeof(temps));
data/apcupsd-3.14.14/src/drivers/apcsmart/smart.c:228:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         retval = read(_ups->fd, &c, 1);
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:221:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   int j = strlen(newname);
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:232:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(name, newname, 9);
data/apcupsd-3.14.14/src/drivers/apcsmart/smarteeprom.c:281:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   int j = strlen(newdate);
data/apcupsd-3.14.14/src/drivers/apcsmart/smartsetup2.c:101:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (strlen(caps) && (strcmp(caps, "NA") != 0)) {
data/apcupsd-3.14.14/src/drivers/modbus/ModbusRs232Comm.cpp:158:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   int rc = read(_fd, frm, MODBUS_MAX_FRAME_SZ);
data/apcupsd-3.14.14/src/drivers/modbus/ModbusRs232Comm.cpp:227:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int rc = read(_fd, *frm+nread, MODBUS_MAX_FRAME_SZ-nread);
data/apcupsd-3.14.14/src/drivers/modbus/ModbusRs232Comm.cpp:281:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int rc = read(_fd, &tmp, 1);
data/apcupsd-3.14.14/src/drivers/modbus/ModbusRs232Comm.cpp:320:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         read(_fd, &tmp, 1);
data/apcupsd-3.14.14/src/drivers/net/net.c:224:48:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      Dmsg(99, "Partial buf (%d, %d):\n%s", n, strlen(_statbuf), buf);
data/apcupsd-3.14.14/src/drivers/net/net.c:238:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   _statlen = strlen(_statbuf);
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:402:43:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      md5_append(&ms, (md5_byte_t*)_user, strlen(_user));
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:403:43:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      md5_append(&ms, (md5_byte_t*)_pass, strlen(_pass));
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:832:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (send(s, data, strlen(data), 0) != (int)strlen(data)) {
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:832:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (send(s, data, strlen(data), 0) != (int)strlen(data)) {
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:874:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   map = auth_and_map_packet(start, strlen(start));
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:895:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   md5_append(&ms, (md5_byte_t*)cs, strlen(cs));
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:896:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   md5_append(&ms, (md5_byte_t*)_user, strlen(_user));
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:897:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   md5_append(&ms, (md5_byte_t*)_pass, strlen(_pass));
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:911:52:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   Dmsg(200, "Request: (strlen=%d)\n---\n%s---\n", strlen(data), data);
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:913:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (send(s, data, strlen(data), 0) != (int)strlen(data)) {
data/apcupsd-3.14.14/src/drivers/pcnet/pcnet.c:913:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (send(s, data, strlen(data), 0) != (int)strlen(data)) {
data/apcupsd-3.14.14/src/drivers/snmplite/asn.cpp:308:41:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   assign((const unsigned char *)value, strlen(value));
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:141:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   intdevname[strlen(intdevname) - 1] = '1';
data/apcupsd-3.14.14/src/drivers/usb/bsd/bsd-usb.c:607:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         retval = read(_intfd, buf, sizeof(buf));
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c:163:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (read(fd, &dd, sizeof(dd)) == sizeof(dd) && 
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c:544:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            retval = read(_fd, &uref, sizeof(uref));
data/apcupsd-3.14.14/src/drivers/usb/linux/linux-usb.c:568:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            retval = read(_fd, &hev, sizeof(hev));
data/apcupsd-3.14.14/src/gapcmon/eggtrayicon.c:430:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      len = strlen(message);
data/apcupsd-3.14.14/src/lib/apcconfig.c:332:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   ptr = x + strlen(x) - 1;
data/apcupsd-3.14.14/src/lib/apcerror.c:53:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   i = strlen(buf);
data/apcupsd-3.14.14/src/lib/apcevents.c:69:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int r = read(ups->event_fd, buf + nbytes, maxb - nbytes);
data/apcupsd-3.14.14/src/lib/apcevents.c:150:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      if (net_send(sockfd, le[i], strlen(le[i])) <= 0)
data/apcupsd-3.14.14/src/lib/apclock.c:78:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if ((size = read(ups->lockfile, &pidbuffer, 11)) == -1) {
data/apcupsd-3.14.14/src/lib/apclock.c:209:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
         strlen(pidbuffer) + 1) != (int)strlen(pidbuffer) + 1) {
data/apcupsd-3.14.14/src/lib/apclock.c:209:41:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
         strlen(pidbuffer) + 1) != (int)strlen(pidbuffer) + 1) {
data/apcupsd-3.14.14/src/lib/apclog.c:68:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      write(event_fd, datetime, strlen(datetime));
data/apcupsd-3.14.14/src/lib/apclog.c:70:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      int lm = strlen(msg);
data/apcupsd-3.14.14/src/lib/apclog.c:147:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
         i = strlen(buf);
data/apcupsd-3.14.14/src/lib/astring.cpp:112:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      _len += strlen(rhs);
data/apcupsd-3.14.14/src/lib/astring.cpp:154:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(data, _data, newsize);
data/apcupsd-3.14.14/src/lib/astring.cpp:167:23:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   _len = (len < 0) ? strlen(str) : len;
data/apcupsd-3.14.14/src/lib/astring.cpp:169:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(_data, str, _len);
data/apcupsd-3.14.14/src/lib/getopt.c:202:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
extern int strlen (const char *);
data/apcupsd-3.14.14/src/lib/getopt.c:490:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	    if (nameend - nextchar == strlen (p->name))
data/apcupsd-3.14.14/src/lib/getopt.c:514:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	  nextchar += strlen (nextchar);
data/apcupsd-3.14.14/src/lib/getopt.c:544:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		  nextchar += strlen (nextchar);
data/apcupsd-3.14.14/src/lib/getopt.c:558:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		  nextchar += strlen (nextchar);
data/apcupsd-3.14.14/src/lib/getopt.c:562:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	  nextchar += strlen (nextchar);
data/apcupsd-3.14.14/src/lib/statmgr.cpp:173:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   char *tmp = str + strlen(str) - 1;
data/apcupsd-3.14.14/src/reports.c:60:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   i = strlen(largebuf);
data/apcupsd-3.14.14/src/reports.c:77:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      buf[strlen(buf) - 1] = 0;
data/apcupsd-3.14.14/src/reports.c:110:4:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
   strncat(largebuf, buf, sizeof(largebuf)-strlen(largebuf)-1);
data/apcupsd-3.14.14/src/reports.c:110:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   strncat(largebuf, buf, sizeof(largebuf)-strlen(largebuf)-1);
data/apcupsd-3.14.14/src/smtp.c:100:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      buf[strlen(buf) - 1] = 0;
data/apcupsd-3.14.14/src/smtp.c:119:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   send(s, temp, strlen(temp), 0);
data/apcupsd-3.14.14/src/smtp.c:376:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      buf[strlen(buf) - 1] = 0;
data/apcupsd-3.14.14/src/win32/apctray.cpp:103:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
         (unsigned char *)cmd, strlen(cmd)+1) != ERROR_SUCCESS) {
data/apcupsd-3.14.14/src/win32/compat/compat.cpp:53:50:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (*fname != 0 && win32_name[-1] == '\\' && strlen (fname) != 3) {
data/apcupsd-3.14.14/src/win32/compat/libusb-winusb-bridge.c:307:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   return strlen(buf);
data/apcupsd-3.14.14/src/win32/email.c:45:10:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
         strncpy(addr, "SMTP:", sizeof(addr));
data/apcupsd-3.14.14/src/win32/instmgr.cpp:360:55:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   RegSetValueEx(hkey, name, 0, REG_SZ, (BYTE*)value, strlen(value)+1);
data/apcupsd-3.14.14/src/win32/popup.c:15:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   int len = strlen(szCmdLine);
data/apcupsd-3.14.14/src/win32/popup.c:37:13:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      len = strlen(szCmdLine);
data/apcupsd-3.14.14/src/win32/winservice.cpp:196:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (strlen(path) + 4 + strlen(ApcupsdRunService) < MAXPATH) {
data/apcupsd-3.14.14/src/win32/winservice.cpp:196:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   if (strlen(path) + 4 + strlen(ApcupsdRunService) < MAXPATH) {
data/apcupsd-3.14.14/src/win32/winservice.cpp:226:42:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            (unsigned char *)servicecmd, strlen(servicecmd)+1) != ERROR_SUCCESS) {

ANALYSIS SUMMARY:

Hits = 668
Lines analyzed = 51325 in approximately 1.43 seconds (35906 lines/second)
Physical Source Lines of Code (SLOC) = 34115
Hits@level = [0] 329 [1] 137 [2] 421 [3]  23 [4]  86 [5]   1
Hits@level+ = [0+] 997 [1+] 668 [2+] 531 [3+] 110 [4+]  87 [5+]   1
Hits/KSLOC@level+ = [0+] 29.2247 [1+] 19.5808 [2+] 15.565 [3+] 3.22439 [4+] 2.5502 [5+] 0.0293126
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.