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/harvid-0.8.3/doc/libharvid_example.c Examining data/harvid-0.8.3/libharvid/decoder_ctrl.c Examining data/harvid-0.8.3/libharvid/decoder_ctrl.h Examining data/harvid-0.8.3/libharvid/dlog.h Examining data/harvid-0.8.3/libharvid/dlog_null.c Examining data/harvid-0.8.3/libharvid/ffcompat.h Examining data/harvid-0.8.3/libharvid/ffdecoder.h Examining data/harvid-0.8.3/libharvid/frame_cache.c Examining data/harvid-0.8.3/libharvid/frame_cache.h Examining data/harvid-0.8.3/libharvid/harvid.h Examining data/harvid-0.8.3/libharvid/image_cache.c Examining data/harvid-0.8.3/libharvid/image_cache.h Examining data/harvid-0.8.3/libharvid/snprintf.c Examining data/harvid-0.8.3/libharvid/timecode.c Examining data/harvid-0.8.3/libharvid/timecode.h Examining data/harvid-0.8.3/libharvid/uthash.h Examining data/harvid-0.8.3/libharvid/vinfo.c Examining data/harvid-0.8.3/libharvid/vinfo.h Examining data/harvid-0.8.3/libharvid/ffdecoder.c Examining data/harvid-0.8.3/src/daemon_log.c Examining data/harvid-0.8.3/src/daemon_log.h Examining data/harvid-0.8.3/src/daemon_util.c Examining data/harvid-0.8.3/src/daemon_util.h Examining data/harvid-0.8.3/src/enums.h Examining data/harvid-0.8.3/src/favicon.h Examining data/harvid-0.8.3/src/fileindex.c Examining data/harvid-0.8.3/src/harvid.c Examining data/harvid-0.8.3/src/htmlconst.h Examining data/harvid-0.8.3/src/htmlseek.c Examining data/harvid-0.8.3/src/httprotocol.c Examining data/harvid-0.8.3/src/httprotocol.h Examining data/harvid-0.8.3/src/ics_handler.c Examining data/harvid-0.8.3/src/ics_handler.h Examining data/harvid-0.8.3/src/image_format.c Examining data/harvid-0.8.3/src/image_format.h Examining data/harvid-0.8.3/src/socket_server.c Examining data/harvid-0.8.3/src/socket_server.h FINAL RESULTS: data/harvid-0.8.3/libharvid/dlog.h:33:18: [4] (format) snprintf: 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. #define SNPRINTF snprintf data/harvid-0.8.3/libharvid/dlog.h:79:60: [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. #define debugmsg(section, ...) {if (debug_section§ion) printf(__VA_ARGS__);} data/harvid-0.8.3/libharvid/dlog.h:85:10: [4] (format) snprintf: 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. off += snprintf(p + off, siz - off, __VA_ARGS__); \ data/harvid-0.8.3/libharvid/dlog.h:92:13: [4] (format) snprintf: 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. (*off) += snprintf((*p) + (*off), (*siz) - (*off), __VA_ARGS__); \ data/harvid-0.8.3/libharvid/frame_cache.c:411:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.0f %s", total_bytes / 1.0, ""); data/harvid-0.8.3/libharvid/frame_cache.c:413:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.1f %s", total_bytes / 1024.0, "Ki"); data/harvid-0.8.3/libharvid/frame_cache.c:415:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.1f %s", total_bytes / 1048576.0, "Mi"); data/harvid-0.8.3/libharvid/frame_cache.c:417:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.2f %s", total_bytes / 1048576.0, "Mi"); data/harvid-0.8.3/libharvid/frame_cache.c:419:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.2f %s", total_bytes / 1073741824.0, "Gi"); data/harvid-0.8.3/libharvid/image_cache.c:293:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.0f %s", total_bytes / 1.0, ""); data/harvid-0.8.3/libharvid/image_cache.c:295:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.1f %s", total_bytes / 1024.0, "Ki"); data/harvid-0.8.3/libharvid/image_cache.c:297:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.1f %s", total_bytes / 1048576.0, "Mi"); data/harvid-0.8.3/libharvid/image_cache.c:299:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.2f %s", total_bytes / 1048576.0, "Mi"); data/harvid-0.8.3/libharvid/image_cache.c:301:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bsize, "%.2f %s", total_bytes / 1073741824.0, "Gi"); data/harvid-0.8.3/libharvid/snprintf.c:396:27: [4] (format) snprintf: 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. #define portable_snprintf snprintf data/harvid-0.8.3/libharvid/snprintf.c:398:28: [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. #define portable_vsnprintf vsnprintf data/harvid-0.8.3/libharvid/snprintf.c:858:45: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. if (fmt_spec == 'p') str_arg_l += sprintf(tmp+str_arg_l, f, ptr_arg); data/harvid-0.8.3/libharvid/snprintf.c:862:34: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. case 'h': str_arg_l+=sprintf(tmp+str_arg_l, f, int_arg); break; data/harvid-0.8.3/libharvid/snprintf.c:863:34: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. case 'l': str_arg_l+=sprintf(tmp+str_arg_l, f, long_arg); break; data/harvid-0.8.3/libharvid/snprintf.c:865:34: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. case '2': str_arg_l+=sprintf(tmp+str_arg_l,f,long_long_arg); break; data/harvid-0.8.3/libharvid/snprintf.c:871:34: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. case 'h': str_arg_l+=sprintf(tmp+str_arg_l, f, uint_arg); break; data/harvid-0.8.3/libharvid/snprintf.c:872:34: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. case 'l': str_arg_l+=sprintf(tmp+str_arg_l, f, ulong_arg); break; data/harvid-0.8.3/libharvid/snprintf.c:874:34: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. case '2': str_arg_l+=sprintf(tmp+str_arg_l,f,ulong_long_arg);break; data/harvid-0.8.3/libharvid/uthash.h:286:29: [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. #define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) data/harvid-0.8.3/src/daemon_log.c:44:3: [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(text, LOGLEN, format, arglist); data/harvid-0.8.3/src/harvid.c:418:8: [4] (format) snprintf: 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. off+=snprintf(msg+off, HPSIZE-off, DOCTYPE HTMLOPEN); data/harvid-0.8.3/src/harvid.c:420:8: [4] (format) snprintf: 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. off+=snprintf(msg+off, HPSIZE-off, HTMLBODY); data/harvid-0.8.3/src/harvid.c:421:8: [4] (format) snprintf: 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. off+=snprintf(msg+off, HPSIZE-off, CENTERDIV); data/harvid-0.8.3/src/harvid.c:459:8: [4] (format) snprintf: 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. off+=snprintf(msg+off, HPSIZE-off, HTMLFOOTER, c->d->local_addr, c->d->local_port); data/harvid-0.8.3/src/harvid.c:511:8: [4] (format) snprintf: 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. off+=snprintf(im+off, NFOSIZ-off, ",\"duration\":%"PRId64, ji->frames); data/harvid-0.8.3/src/harvid.c:525:8: [4] (format) snprintf: 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. off+=snprintf(im+off, NFOSIZ-off, ",%"PRId64, ji->frames); data/harvid-0.8.3/src/harvid.c:538:8: [4] (format) snprintf: 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. off+=snprintf(im+off, FIHSIZ-off, DOCTYPE HTMLOPEN); data/harvid-0.8.3/src/harvid.c:540:8: [4] (format) snprintf: 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. off+=snprintf(im+off, FIHSIZ-off, HTMLBODY); data/harvid-0.8.3/src/harvid.c:541:8: [4] (format) snprintf: 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. off+=snprintf(im+off, FIHSIZ-off, CENTERDIV); data/harvid-0.8.3/src/harvid.c:556:8: [4] (format) snprintf: 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. off+=snprintf(im+off, FIHSIZ-off, HTMLFOOTER, c->d->local_addr, c->d->local_port); data/harvid-0.8.3/src/harvid.c:653:12: [4] (format) snprintf: 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. off+=snprintf(info+off, SINFOSIZ-off, DOCTYPE HTMLOPEN); data/harvid-0.8.3/src/harvid.c:655:12: [4] (format) snprintf: 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. off+=snprintf(info+off, SINFOSIZ-off, HTMLBODY); data/harvid-0.8.3/src/harvid.c:656:12: [4] (format) snprintf: 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. off+=snprintf(info+off, SINFOSIZ-off, CENTERDIV); data/harvid-0.8.3/src/harvid.c:682:12: [4] (format) snprintf: 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. off+=snprintf(info+off, SINFOSIZ-off, HTMLFOOTER, c->d->local_addr, c->d->local_port); data/harvid-0.8.3/src/harvid.c:715:12: [4] (format) snprintf: 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. off+=snprintf(info+off, SINFOSIZ-off, DOCTYPE HTMLOPEN); data/harvid-0.8.3/src/harvid.c:717:12: [4] (format) snprintf: 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. off+=snprintf(info+off, SINFOSIZ-off, HTMLBODY); data/harvid-0.8.3/src/harvid.c:718:12: [4] (format) snprintf: 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. off+=snprintf(info+off, SINFOSIZ-off, CENTERDIV); data/harvid-0.8.3/src/harvid.c:730:12: [4] (format) snprintf: 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. off+=snprintf(info+off, SINFOSIZ-off, HTMLFOOTER, c->d->local_addr, c->d->local_port); data/harvid-0.8.3/src/htmlseek.c:34:8: [4] (format) snprintf: 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. off+=snprintf(im+off, FIHSIZ-off, DOCTYPE HTMLOPEN); data/harvid-0.8.3/src/htmlseek.c:47:8: [4] (format) snprintf: 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. off+=snprintf(im+off, FIHSIZ-off, HTMLBODY); data/harvid-0.8.3/src/htmlseek.c:97:8: [4] (format) snprintf: 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. off+=snprintf(im+off, FIHSIZ-off, HTMLFOOTER, c->d->local_addr, c->d->local_port); data/harvid-0.8.3/src/httprotocol.c:114:10: [4] (format) snprintf: 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. off += snprintf(hd+off, HTHSIZE-off, DOCTYPE HTMLOPEN); data/harvid-0.8.3/src/httprotocol.c:123:10: [4] (format) snprintf: 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. off += snprintf(hd+off, HTHSIZE-off, ERRFOOTER); data/harvid-0.8.3/src/ics_handler.c:162:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(a->file_name, "%s%s", c->d->docroot, qps.fn); data/harvid-0.8.3/src/ics_handler.c:179:9: [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. if (access(a->file_name, R_OK)) { data/harvid-0.8.3/src/ics_handler.c:351:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(abspath, "%s%s%s", c->d->docroot, strlen(c->d->docroot) > 0 ? "/" : "", dp); data/harvid-0.8.3/src/ics_handler.c:366:16: [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. } else if (access(abspath, R_OK)) { data/harvid-0.8.3/src/socket_server.c:339:33: [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. if (strlen(d->docroot) > 0 && access(d->docroot, R_OK)) { data/harvid-0.8.3/src/daemon_util.c:136:8: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if(chroot(chroot_dir)) { data/harvid-0.8.3/src/harvid.c:174:15: [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. while ((c = getopt_long (argc, argv, data/harvid-0.8.3/src/image_format.c:153:5: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(tv.tv_sec * tv.tv_usec * 100000); data/harvid-0.8.3/doc/libharvid_example.c:90: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). FILE *x = fopen(outfn, "w"); data/harvid-0.8.3/libharvid/decoder_ctrl.c:840: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. off += sprintf(rv+off, "used "); data/harvid-0.8.3/libharvid/decoder_ctrl.c:844: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. off += sprintf(rv+off, "open "); data/harvid-0.8.3/libharvid/decoder_ctrl.c:848: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. off += sprintf(rv+off, "hasID "); data/harvid-0.8.3/libharvid/decoder_ctrl.c:852: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. off += sprintf(rv+off, "pending "); data/harvid-0.8.3/libharvid/decoder_ctrl.c:856: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. off += sprintf(rv+off, "info "); data/harvid-0.8.3/libharvid/ffdecoder.c:737: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(&i->framerate, &ff->tc, sizeof(TimecodeRate)); data/harvid-0.8.3/libharvid/frame_cache.c:358: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. off += sprintf(rv+off, "decoding "); data/harvid-0.8.3/libharvid/frame_cache.c:362: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. off += sprintf(rv+off, "valid "); data/harvid-0.8.3/libharvid/frame_cache.c:366: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. off += sprintf(rv+off, "in-use "); data/harvid-0.8.3/libharvid/frame_cache.c:370: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. off += sprintf(rv+off, "to-free "); data/harvid-0.8.3/libharvid/frame_cache.c:379: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 bsize[32]; data/harvid-0.8.3/libharvid/image_cache.c:223: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. off += sprintf(rv+off, "valid "); data/harvid-0.8.3/libharvid/image_cache.c:227: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. off += sprintf(rv+off, "in-use "); data/harvid-0.8.3/libharvid/image_cache.c:249: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 bsize[32]; data/harvid-0.8.3/libharvid/snprintf.c:364:32: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (nn >= breakeven_point) memcpy((d), (s), nn); \ data/harvid-0.8.3/libharvid/snprintf.c:574: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[32];/* temporary buffer for simple numeric->string conversion */ data/harvid-0.8.3/libharvid/snprintf.c:852: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. char f[5]; int f_l = 0; data/harvid-0.8.3/src/daemon_log.c:37: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 text[LOGLEN], timestamped[LOGLEN]; data/harvid-0.8.3/src/daemon_log.c:96: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). if ((fd = open(log_file, O_CREAT|O_WRONLY|O_APPEND, 0640))) { data/harvid-0.8.3/src/daemon_util.c:66:11: [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). else if(atoi(setuid_user)) /* numerical? */ data/harvid-0.8.3/src/daemon_util.c:67:11: [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). uid = atoi(setuid_user); data/harvid-0.8.3/src/daemon_util.c:88:11: [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). else if(atoi(setgid_group)) /* numerical? */ data/harvid-0.8.3/src/daemon_util.c:89:11: [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). gid = atoi(setgid_group); data/harvid-0.8.3/src/fileindex.c:245: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 dn[MAX_PATH]; data/harvid-0.8.3/src/fileindex.c:257: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 rn[MAX_PATH]; // absolute, starting at local root / data/harvid-0.8.3/src/fileindex.c:267: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 fn[MAX_PATH]; // relative to this *root. data/harvid-0.8.3/src/fileindex.c:271: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. char pn[MAX_PATH]; data/harvid-0.8.3/src/harvid.c:224:30: [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). initial_cache_size = atoi(optarg); data/harvid-0.8.3/src/harvid.c:266: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 pn = atoi(optarg); data/harvid-0.8.3/src/harvid.c:268:39: [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). cfg_port = (unsigned short) atoi(optarg); data/harvid-0.8.3/src/harvid.c:277:31: [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). max_decoder_threads = atoi(optarg); data/harvid-0.8.3/src/harvid.c:282: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). cfg_timeout = atoi(optarg); data/harvid-0.8.3/src/harvid.c:535: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 smpte[14], *tmp; data/harvid-0.8.3/src/harvid.c:565: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 smpte[14]; data/harvid-0.8.3/src/htmlseek.c:31: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 smpte[14]; data/harvid-0.8.3/src/httprotocol.c:43: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 http_head[128]; data/harvid-0.8.3/src/httprotocol.c:68: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 hd[HTHSIZE]; data/harvid-0.8.3/src/httprotocol.c:71: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 timebuf[100]; data/harvid-0.8.3/src/httprotocol.c:107: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 hd[HTHSIZE]; data/harvid-0.8.3/src/httprotocol.c:253: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 hexstr[3]; data/harvid-0.8.3/src/ics_handler.c:96: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). qps->a->frame = atoi(val); data/harvid-0.8.3/src/ics_handler.c:99:26: [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). qps->a->out_width = atoi(val); data/harvid-0.8.3/src/ics_handler.c:101:26: [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). qps->a->out_height = atoi(val); data/harvid-0.8.3/src/ics_handler.c:108:89: [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). if (!strncmp(val, "jpg",3)) {qps->a->render_fmt = FMT_JPG; qps->a->misc_int = atoi(&val[3]);} data/harvid-0.8.3/src/ics_handler.c:109:89: [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). else if (!strncmp(val, "jpeg",4)) {qps->a->render_fmt = FMT_JPG; qps->a->misc_int = atoi(&val[4]);} data/harvid-0.8.3/src/ics_handler.c:372: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 base_url[1024]; data/harvid-0.8.3/src/image_format.c:134:10: [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). return fopen(filename, "w+"); data/harvid-0.8.3/src/image_format.c:139: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 tfn[64] = ""; data/harvid-0.8.3/src/image_format.c:145:13: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). FILE *x = tmpfile(); data/harvid-0.8.3/src/image_format.c:155:9: [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). x = fopen(tfn, "w+b"); // we should really use open(tfn, O_RDWR | O_CREAT | O_EXCL, 0600); and fdopen data/harvid-0.8.3/src/image_format.c:192:9: [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). x = fopen(tfn, "rb"); data/harvid-0.8.3/src/socket_server.h:86: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 buf[BUFSIZ]; ///< Socket read buffer data/harvid-0.8.3/libharvid/decoder_ctrl.c:510: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). HASH_ADD_KEYPTR(hh, jvd->vml, vm->fn, strlen(vm->fn), vm); data/harvid-0.8.3/libharvid/decoder_ctrl.c:835:12: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. off += sprintf(rv+off, "-"); data/harvid-0.8.3/libharvid/dlog.h:32:22: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. #define mymsleep(ms) usleep((ms) * 1000) data/harvid-0.8.3/libharvid/frame_cache.c:353:12: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. off += sprintf(rv+off, "-"); data/harvid-0.8.3/libharvid/image_cache.c:218:12: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. off += sprintf(rv+off, "-"); data/harvid-0.8.3/libharvid/snprintf.c:560: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). size_t n = !q ? strlen(p) : (q-p); data/harvid-0.8.3/libharvid/snprintf.c:702: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). else if (!precision_specified) str_arg_l = strlen(str_arg); data/harvid-0.8.3/libharvid/uthash.h:262: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). HASH_FIND(hh,head,findstr,(unsigned)strlen(findstr),out) data/harvid-0.8.3/libharvid/uthash.h:264: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). HASH_ADD(hh,head,strfield[0],strlen(add->strfield),add) data/harvid-0.8.3/libharvid/uthash.h:266: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). HASH_REPLACE(hh,head,strfield[0],(unsigned)strlen(add->strfield),add,replaced) data/harvid-0.8.3/src/fileindex.c:51: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 (inlength == 0) inlength = strlen(string)+1; data/harvid-0.8.3/src/fileindex.c:201: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). const int l3 = strlen(name) - 3; data/harvid-0.8.3/src/fileindex.c:260: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). int delen = strlen(d->d_name); data/harvid-0.8.3/src/fileindex.c:277: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). if (strlen(*m) > 0) { data/harvid-0.8.3/src/fileindex.c:310: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 bl = strlen(base_url) - 1; data/harvid-0.8.3/src/fileindex.c:333:56: [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). raprintf(sm, off, ss, "<p>Path: %s</p>\n<ul>\n", strlen(path) > 0 ? path : "<em>(docroot)</em>"); data/harvid-0.8.3/src/fileindex.c:374:7: [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(sm) > 0) CSEND(fd, sm); data/harvid-0.8.3/src/harvid.c:352:7: [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 (docroot) == 0) { data/harvid-0.8.3/src/httprotocol.c:118: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 (str && strlen(str)>0) { data/harvid-0.8.3/src/httprotocol.c:182:45: [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 alloc = (inlength?(size_t)inlength:strlen(string))+1; data/harvid-0.8.3/src/httprotocol.c:241: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). int alloc = (length?length:(int)strlen(string))+1; data/harvid-0.8.3/src/httprotocol.c:328:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int num = read(c->fd, c->buf, BUFSIZ); data/harvid-0.8.3/src/httprotocol.c:383:71: [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). debugmsg(DEBUG_HTTP, "HTTP: CON header-len: %lu\n", (long unsigned) strlen(header)); data/harvid-0.8.3/src/httprotocol.c:385: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). debugmsg(DEBUG_HTTP, "HTTP: CON header-len: %zu\n", strlen(header)); data/harvid-0.8.3/src/httprotocol.c:475:49: [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). && (contentlength > 0 && contentlength <= strlen(header) /* - (header-c->buf) */ /* -num */) data/harvid-0.8.3/src/httprotocol.c:480:105: [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). debugmsg(DEBUG_CON, "HTTP: translate POST->GET query - length data:%lu cl:%ld\n", (long unsigned) strlen(header), contentlength); data/harvid-0.8.3/src/httprotocol.c:482:89: [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). debugmsg(DEBUG_CON, "HTTP: translate POST->GET query - length data:%zu cl:%ld\n", strlen(header), contentlength); data/harvid-0.8.3/src/httprotocol.h:44:25: [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). #define SL_SEP(string) (strlen(string)>0?(string[strlen(string)-1]=='/' || string[strlen(string)-1]=='\\')?"":"\\":"") data/harvid-0.8.3/src/httprotocol.h:44: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). #define SL_SEP(string) (strlen(string)>0?(string[strlen(string)-1]=='/' || string[strlen(string)-1]=='\\')?"":"\\":"") data/harvid-0.8.3/src/httprotocol.h:44:83: [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). #define SL_SEP(string) (strlen(string)>0?(string[strlen(string)-1]=='/' || string[strlen(string)-1]=='\\')?"":"\\":"") data/harvid-0.8.3/src/httprotocol.h:46:25: [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). #define SL_SEP(string) (strlen(string)>0?(string[strlen(string)-1]=='/')?"":"/":"") data/harvid-0.8.3/src/httprotocol.h:46: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). #define SL_SEP(string) (strlen(string)>0?(string[strlen(string)-1]=='/')?"":"/":"") data/harvid-0.8.3/src/httprotocol.h:57: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). #define CSEND(FD,MSG) write(FD, MSG, strlen(MSG)) data/harvid-0.8.3/src/httprotocol.h:59: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). #define CSEND(FD,MSG) send(FD, MSG, strlen(MSG), 0) data/harvid-0.8.3/src/ics_handler.c:39: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). && strncasecmp(path, CMPPATH, strlen(CMPPATH)) == 0 \ data/harvid-0.8.3/src/ics_handler.c:68:9: [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(f); data/harvid-0.8.3/src/ics_handler.c:91: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). if (!val || strlen(val) < 1 || strlen(kvp) <1) return; data/harvid-0.8.3/src/ics_handler.c:91: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). if (!val || strlen(val) < 1 || strlen(kvp) <1) return; data/harvid-0.8.3/src/ics_handler.c:161: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). a->file_name = malloc(1+strlen(c->d->docroot)+strlen(qps.fn)*sizeof(char)); data/harvid-0.8.3/src/ics_handler.c:161:53: [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). a->file_name = malloc(1+strlen(c->d->docroot)+strlen(qps.fn)*sizeof(char)); data/harvid-0.8.3/src/ics_handler.c:350:29: [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 *abspath = malloc((strlen(c->d->docroot) + strlen(dp) + 2) * sizeof(char)); data/harvid-0.8.3/src/ics_handler.c:350:53: [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 *abspath = malloc((strlen(c->d->docroot) + strlen(dp) + 2) * sizeof(char)); data/harvid-0.8.3/src/ics_handler.c:351: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). sprintf(abspath, "%s%s%s", c->d->docroot, strlen(c->d->docroot) > 0 ? "/" : "", dp); data/harvid-0.8.3/src/ics_handler.c:355: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). if (strlen (abspath) > 0 && abspath[strlen(abspath) - 1] == '\\') { data/harvid-0.8.3/src/ics_handler.c:355: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). if (strlen (abspath) > 0 && abspath[strlen(abspath) - 1] == '\\') { data/harvid-0.8.3/src/ics_handler.c:356: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). abspath[strlen(abspath) - 1] = '\0'; data/harvid-0.8.3/src/ics_handler.c:413: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). } else if (CTP("/") && !strcmp(path, "/") && strlen(query) == 0) { /* HOMEPAGE */ data/harvid-0.8.3/src/image_format.c:190:7: [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(tfn) > 0) { data/harvid-0.8.3/src/image_format.c:213:7: [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(tfn) > 0) { data/harvid-0.8.3/src/socket_server.c:339:7: [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(d->docroot) > 0 && access(d->docroot, R_OK)) { ANALYSIS SUMMARY: Hits = 159 Lines analyzed = 9213 in approximately 0.37 seconds (25005 lines/second) Physical Source Lines of Code (SLOC) = 6655 Hits@level = [0] 209 [1] 50 [2] 53 [3] 3 [4] 53 [5] 0 Hits@level+ = [0+] 368 [1+] 159 [2+] 109 [3+] 56 [4+] 53 [5+] 0 Hits/KSLOC@level+ = [0+] 55.2968 [1+] 23.8918 [2+] 16.3787 [3+] 8.41473 [4+] 7.96394 [5+] 0 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.