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/gntp-send-0.3.4/include/tcp.h Examining data/gntp-send-0.3.4/include/growl.h Examining data/gntp-send-0.3.4/include/md5.h Examining data/gntp-send-0.3.4/src/growl.c Examining data/gntp-send-0.3.4/src/tcp.c Examining data/gntp-send-0.3.4/src/md5.c Examining data/gntp-send-0.3.4/src/gntp-send.c FINAL RESULTS: data/gntp-send-0.3.4/include/tcp.h:9:91: [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. void growl_tcp_write( int sock , const char *const format , ... ) __attribute__ ((format (printf, 2, 3))); data/gntp-send-0.3.4/src/gntp-send.c:141: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(message, buf); data/gntp-send-0.3.4/src/growl.c:100:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(auth_header, " MD5:%s.%s", keyhash, salthash); data/gntp-send-0.3.4/src/growl.c:493:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)data + pointer, "%s", appname); data/gntp-send-0.3.4/src/growl.c:500:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)data + pointer, "%s", notifications[i]); data/gntp-send-0.3.4/src/growl.c:559: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((char*)data + pointer, notify); data/gntp-send-0.3.4/src/growl.c:561: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((char*)data + pointer, title); data/gntp-send-0.3.4/src/growl.c:563: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((char*)data + pointer, message); data/gntp-send-0.3.4/src/growl.c:565: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((char*)data + pointer, appname); data/gntp-send-0.3.4/src/tcp.c:57:12: [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. length = vsnprintf(NULL, 0, format, ap); data/gntp-send-0.3.4/src/tcp.c:66: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(output, length+1, format, ap); data/gntp-send-0.3.4/src/tcp.c:69:43: [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 ((stop = strstr(output, "\r\n"))) strcpy(stop, stop + 1); data/gntp-send-0.3.4/src/growl.c:42: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(time(NULL)); data/gntp-send-0.3.4/src/gntp-send.c:23:13: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). wcssize = MultiByteToWideChar(codepage, 0, str, in_len, NULL, 0); data/gntp-send-0.3.4/src/gntp-send.c:25:13: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). wcssize = MultiByteToWideChar(codepage, 0, str, in_len, wcsdata, wcssize + 1); data/gntp-send-0.3.4/src/gntp-send.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 buf[BUFSIZ], *ptr; data/gntp-send-0.3.4/src/growl.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 md5tmp[20] = {0}; data/gntp-send-0.3.4/src/growl.c:140:17: [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). icon_file = fopen(icon, "rb"); data/gntp-send-0.3.4/src/growl.c:251:17: [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). icon_file = fopen(icon, "rb"); data/gntp-send-0.3.4/src/growl.c:439: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 md5tmp[20] = {0}; data/gntp-send-0.3.4/src/growl.c:448: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(data + data_length, md5tmp, 16); data/gntp-send-0.3.4/src/growl.c:483: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(data + pointer, &GROWL_PROTOCOL_VERSION, 1); data/gntp-send-0.3.4/src/growl.c:485: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(data + pointer, &GROWL_TYPE_REGISTRATION, 1); data/gntp-send-0.3.4/src/growl.c:487: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(data + pointer, &appname_length, 2); data/gntp-send-0.3.4/src/growl.c:489: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(data + pointer, &_notifications_count, 1); data/gntp-send-0.3.4/src/growl.c:491: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(data + pointer, &default_notifications_count, 1); data/gntp-send-0.3.4/src/growl.c:498: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(data + pointer, ¬ify_length, 2); data/gntp-send-0.3.4/src/growl.c:505: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(data + pointer, &j, 1); data/gntp-send-0.3.4/src/growl.c:545: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(data + pointer, &GROWL_PROTOCOL_VERSION, 1); data/gntp-send-0.3.4/src/growl.c:547: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(data + pointer, &GROWL_TYPE_NOTIFICATION, 1); data/gntp-send-0.3.4/src/growl.c:549: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(data + pointer, &flags, 2); data/gntp-send-0.3.4/src/growl.c:551: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(data + pointer, ¬ify_length, 2); data/gntp-send-0.3.4/src/growl.c:553: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(data + pointer, &title_length, 2); data/gntp-send-0.3.4/src/growl.c:555: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(data + pointer, &message_length, 2); data/gntp-send-0.3.4/src/growl.c:557: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(data + pointer, &appname_length, 2); data/gntp-send-0.3.4/src/md5.c:159: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((void *)(ctx->buffer + left), (const void *)input, fill); data/gntp-send-0.3.4/src/md5.c:173: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((void *)(ctx->buffer + left), (const void *)input, length); data/gntp-send-0.3.4/src/tcp.c:10: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[200]; data/gntp-send-0.3.4/src/tcp.c:161: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). default_port = atoi(port); data/gntp-send-0.3.4/src/tcp.c:172: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(&sockaddr->sin_addr, host_ent->h_addr, host_ent->h_length); data/gntp-send-0.3.4/src/gntp-send.c:17: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). size_t in_len = strlen(str); data/gntp-send-0.3.4/src/gntp-send.c:135: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). message = malloc(strlen(buf) + 2); data/gntp-send-0.3.4/src/gntp-send.c:138:9: [1] (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 character. strcat(message, "\n"); data/gntp-send-0.3.4/src/gntp-send.c:139:36: [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). message = realloc(message, strlen(message)+strlen(buf) + 2); data/gntp-send-0.3.4/src/gntp-send.c:139: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). message = realloc(message, strlen(message)+strlen(buf) + 2); data/gntp-send-0.3.4/src/growl.c:75: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_update(&md5ctx, (uint8_t*)password, strlen(password)); data/gntp-send-0.3.4/src/growl.c:76:39: [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_update(&md5ctx, (uint8_t*)salt, strlen(salt)); data/gntp-send-0.3.4/src/growl.c:98:39: [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). auth_header = (char*)malloc(strlen(keyhash) + strlen(salthash) + 7); data/gntp-send-0.3.4/src/growl.c:98:57: [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). auth_header = (char*)malloc(strlen(keyhash) + strlen(salthash) + 7); data/gntp-send-0.3.4/src/growl.c:199: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 len = strlen(line); data/gntp-send-0.3.4/src/growl.c:300: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 len = strlen(line); data/gntp-send-0.3.4/src/growl.c:387: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 len = strlen(line); data/gntp-send-0.3.4/src/growl.c:444: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). md5_update(&md5ctx, (uint8_t*)password, strlen(password)); data/gntp-send-0.3.4/src/growl.c:460: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 register_header_length = 22+strlen(appname); data/gntp-send-0.3.4/src/growl.c:469: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). uint16_t appname_length = ntohs(strlen(appname)); data/gntp-send-0.3.4/src/growl.c:477: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). register_header_length += 3 + strlen(notifications[i]); data/gntp-send-0.3.4/src/growl.c:494: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). pointer += strlen(appname); data/gntp-send-0.3.4/src/growl.c:497:36: [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). uint16_t notify_length = ntohs(strlen(notifications[i])); data/gntp-send-0.3.4/src/growl.c:501: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). pointer += strlen(notifications[i]); data/gntp-send-0.3.4/src/growl.c:526: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 notify_header_length = 28 + strlen(appname)+strlen(notify)+strlen(message)+strlen(title); data/gntp-send-0.3.4/src/growl.c:526:51: [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 notify_header_length = 28 + strlen(appname)+strlen(notify)+strlen(message)+strlen(title); data/gntp-send-0.3.4/src/growl.c:526:66: [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 notify_header_length = 28 + strlen(appname)+strlen(notify)+strlen(message)+strlen(title); data/gntp-send-0.3.4/src/growl.c:526:82: [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 notify_header_length = 28 + strlen(appname)+strlen(notify)+strlen(message)+strlen(title); data/gntp-send-0.3.4/src/growl.c:535: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). uint16_t appname_length = ntohs(strlen(appname)); data/gntp-send-0.3.4/src/growl.c:536: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). uint16_t notify_length = ntohs(strlen(notify)); data/gntp-send-0.3.4/src/growl.c:537: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). uint16_t title_length = ntohs(strlen(title)); data/gntp-send-0.3.4/src/growl.c:538: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). uint16_t message_length = ntohs(strlen(message)); data/gntp-send-0.3.4/src/growl.c:560: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). pointer += strlen(notify); data/gntp-send-0.3.4/src/growl.c:562: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). pointer += strlen(title); data/gntp-send-0.3.4/src/growl.c:564: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). pointer += strlen(message); data/gntp-send-0.3.4/src/growl.c:566: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). pointer += strlen(appname); ANALYSIS SUMMARY: Hits = 71 Lines analyzed = 1299 in approximately 0.07 seconds (17921 lines/second) Physical Source Lines of Code (SLOC) = 1095 Hits@level = [0] 10 [1] 31 [2] 27 [3] 1 [4] 12 [5] 0 Hits@level+ = [0+] 81 [1+] 71 [2+] 40 [3+] 13 [4+] 12 [5+] 0 Hits/KSLOC@level+ = [0+] 73.9726 [1+] 64.8402 [2+] 36.5297 [3+] 11.8721 [4+] 10.9589 [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.