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/python-hiredis-1.0.1/vendor/hiredis/read.c Examining data/python-hiredis-1.0.1/vendor/hiredis/dict.h Examining data/python-hiredis-1.0.1/vendor/hiredis/dict.c Examining data/python-hiredis-1.0.1/vendor/hiredis/read.h Examining data/python-hiredis-1.0.1/vendor/hiredis/async.c Examining data/python-hiredis-1.0.1/vendor/hiredis/hiredis.h Examining data/python-hiredis-1.0.1/vendor/hiredis/net.c Examining data/python-hiredis-1.0.1/vendor/hiredis/test.c Examining data/python-hiredis-1.0.1/vendor/hiredis/win32.h Examining data/python-hiredis-1.0.1/vendor/hiredis/sds.h Examining data/python-hiredis-1.0.1/vendor/hiredis/net.h Examining data/python-hiredis-1.0.1/vendor/hiredis/fmacros.h Examining data/python-hiredis-1.0.1/vendor/hiredis/sds.c Examining data/python-hiredis-1.0.1/vendor/hiredis/async.h Examining data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c Examining data/python-hiredis-1.0.1/src/hiredis.h Examining data/python-hiredis-1.0.1/src/reader.h Examining data/python-hiredis-1.0.1/src/reader.c Examining data/python-hiredis-1.0.1/src/hiredis.c FINAL RESULTS: data/python-hiredis-1.0.1/vendor/hiredis/sds.c:370:9: [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(buf, buflen, fmt, cpy); data/python-hiredis-1.0.1/vendor/hiredis/sds.h:77:27: [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. __attribute__((format(printf, 2, 3))); data/python-hiredis-1.0.1/vendor/hiredis/test.c:38:47: [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 test(_s) { printf("#%02d ", ++tests); printf(_s); } data/python-hiredis-1.0.1/vendor/hiredis/win32.h:13:9: [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. #ifndef snprintf data/python-hiredis-1.0.1/vendor/hiredis/win32.h:14:9: [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 c99_snprintf data/python-hiredis-1.0.1/vendor/hiredis/async.c:72:5: [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(dup,src,sizeof(*dup)); data/python-hiredis-1.0.1/vendor/hiredis/async.c:236:9: [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(cb,source,sizeof(*cb)); data/python-hiredis-1.0.1/vendor/hiredis/async.c:258:13: [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(target,cb,sizeof(*cb)); data/python-hiredis-1.0.1/vendor/hiredis/async.c:390:13: [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(dstcb,dictGetEntryVal(de),sizeof(*dstcb)); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:121:5: [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(buf,str,len); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:280:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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[16]; data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:359: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(_format,c,_l); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:403:11: [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. pos = sprintf(cmd,"*%d\r\n",argc); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:405:16: [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. pos += sprintf(cmd+pos,"$%zu\r\n",sdslen(curargv[j])); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:406:9: [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(cmd+pos,curargv[j],sdslen(curargv[j])); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:552:11: [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. pos = sprintf(cmd,"*%d\r\n",argc); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:555:16: [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. pos += sprintf(cmd+pos,"$%zu\r\n",len); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:556:9: [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(cmd+pos,argv[j],len); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:579:9: [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(c->errstr,str,len); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:795: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[1024*16]; data/python-hiredis-1.0.1/vendor/hiredis/hiredis.h:142: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 errstr[128]; /* String representation of error when applicable */ data/python-hiredis-1.0.1/vendor/hiredis/net.c:68: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[128] = { 0 }; data/python-hiredis-1.0.1/vendor/hiredis/net.c:263: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 _port[6]; /* strlen("65535"); */ data/python-hiredis-1.0.1/vendor/hiredis/net.c:291:13: [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(c->timeout, timeout, sizeof(struct timeval)); data/python-hiredis-1.0.1/vendor/hiredis/net.c:336:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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[128]; data/python-hiredis-1.0.1/vendor/hiredis/net.c:358:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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[128]; data/python-hiredis-1.0.1/vendor/hiredis/net.c:391: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 buf[128]; data/python-hiredis-1.0.1/vendor/hiredis/net.c:433:13: [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(c->timeout, timeout, sizeof(struct timeval)); data/python-hiredis-1.0.1/vendor/hiredis/read.c:68:5: [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->errstr,str,len); data/python-hiredis-1.0.1/vendor/hiredis/read.c:97: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 cbuf[8], sbuf[128]; data/python-hiredis-1.0.1/vendor/hiredis/read.h:82: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 errstr[128]; /* String representation of error when applicable */ data/python-hiredis-1.0.1/vendor/hiredis/sds.c:63:9: [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(sh->buf, init, initlen); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:244:5: [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(s+curlen, t, len); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:279:5: [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(s, t, len); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:460:17: [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(s+i,str,l); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:472:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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[SDS_LLSTR_SIZE]; data/python-hiredis-1.0.1/vendor/hiredis/sds.c:478:21: [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(s+i,buf,l); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:494:21: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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[SDS_LLSTR_SIZE]; data/python-hiredis-1.0.1/vendor/hiredis/sds.c:500:21: [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(s+i,buf,l); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:720: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[32], *p; data/python-hiredis-1.0.1/vendor/hiredis/test.c:209: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. const char *argv[3]; data/python-hiredis-1.0.1/vendor/hiredis/test.c:757:28: [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.tcp.port = atoi(argv[0]); data/python-hiredis-1.0.1/src/reader.c:296:61: [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). err = createError(self->protocolErrorClass, errstr, strlen(errstr)); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:262:24: [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 = strlen(arg); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:492: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). len = argvlen ? argvlen[j] : strlen(argv[j]); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:509: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). len = argvlen ? argvlen[j] : strlen(argv[j]); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:543: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). len = argvlen ? argvlen[j] : strlen(argv[j]); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:554: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). len = argvlen ? argvlen[j] : strlen(argv[j]); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:577: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(str); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:645: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). memset(c->errstr, '\0', strlen(c->errstr)); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.c:802:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nread = read(c->fd,buf,sizeof(buf)); data/python-hiredis-1.0.1/vendor/hiredis/hiredis.h:102:13: [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((buf), err_str, ((len) - 1)); \ data/python-hiredis-1.0.1/vendor/hiredis/net.c:442:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sa.sun_path,path,sizeof(sa.sun_path)-1); data/python-hiredis-1.0.1/vendor/hiredis/read.c:66: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). len = strlen(str); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:76: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). size_t initlen = (init == NULL) ? 0 : strlen(init); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:107:19: [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 reallen = strlen(s); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:256: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). return sdscatlen(s, t, strlen(t)); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:289: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). return sdscpylen(s, t, strlen(t)); data/python-hiredis-1.0.1/vendor/hiredis/sds.c:455: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). l = (next == 's') ? strlen(str) : sdslen(str); data/python-hiredis-1.0.1/vendor/hiredis/test.c:469: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). s = write(c->fd, cmd, strlen(cmd)); data/python-hiredis-1.0.1/vendor/hiredis/test.c:509:26: [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). major = strtol(p+strlen(field),&eptr,10); ANALYSIS SUMMARY: Hits = 61 Lines analyzed = 6249 in approximately 0.20 seconds (31720 lines/second) Physical Source Lines of Code (SLOC) = 4206 Hits@level = [0] 32 [1] 19 [2] 37 [3] 0 [4] 5 [5] 0 Hits@level+ = [0+] 93 [1+] 61 [2+] 42 [3+] 5 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 22.1113 [1+] 14.5031 [2+] 9.98573 [3+] 1.18878 [4+] 1.18878 [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.