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/log4c-1.2.4/examples/application_3.h Examining data/log4c-1.2.4/examples/application_3.c Examining data/log4c-1.2.4/examples/helloworld1/helloworld1.c Examining data/log4c-1.2.4/examples/helloworld1/mylog.h Examining data/log4c-1.2.4/examples/application_2.c Examining data/log4c-1.2.4/examples/helloworld/helloworld.c Examining data/log4c-1.2.4/examples/example_formatters.c Examining data/log4c-1.2.4/examples/example_appenders.c Examining data/log4c-1.2.4/examples/application_1.c Examining data/log4c-1.2.4/examples/userloc_formatter.c Examining data/log4c-1.2.4/src/log4c/layout_type_basic_r.c Examining data/log4c-1.2.4/src/log4c/rc.h Examining data/log4c-1.2.4/src/log4c/layout.h Examining data/log4c-1.2.4/src/log4c/layout_type_dated_local.c Examining data/log4c-1.2.4/src/log4c/logging_event.h Examining data/log4c-1.2.4/src/log4c/layout_type_basic_r.h Examining data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.h Examining data/log4c-1.2.4/src/log4c/appender_type_syslog.c Examining data/log4c-1.2.4/src/log4c/appender_type_stream.h Examining data/log4c-1.2.4/src/log4c/defs.h Examining data/log4c-1.2.4/src/log4c/appender_type_rollingfile.c Examining data/log4c-1.2.4/src/log4c/logging_event.c Examining data/log4c-1.2.4/src/log4c/appender_type_syslog.h Examining data/log4c-1.2.4/src/log4c/buffer.h Examining data/log4c-1.2.4/src/log4c/layout_type_dated_local_r.c Examining data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.c Examining data/log4c-1.2.4/src/log4c/priority.h Examining data/log4c-1.2.4/src/log4c/layout_type_dated.c Examining data/log4c-1.2.4/src/log4c/init.h Examining data/log4c-1.2.4/src/log4c/category.c Examining data/log4c-1.2.4/src/log4c/rollingpolicy.c Examining data/log4c-1.2.4/src/log4c/config-win32.h Examining data/log4c-1.2.4/src/log4c/init.c Examining data/log4c-1.2.4/src/log4c/layout_type_dated_local.h Examining data/log4c-1.2.4/src/log4c/layout_type_basic.c Examining data/log4c-1.2.4/src/log4c/appender.h Examining data/log4c-1.2.4/src/log4c/appender_type_mmap.h Examining data/log4c-1.2.4/src/log4c/layout_type_dated.h Examining data/log4c-1.2.4/src/log4c/layout_type_dated_r.h Examining data/log4c-1.2.4/src/log4c/rollingpolicy.h Examining data/log4c-1.2.4/src/log4c/version.c Examining data/log4c-1.2.4/src/log4c/rc.c Examining data/log4c-1.2.4/src/log4c/version.h Examining data/log4c-1.2.4/src/log4c/appender.c Examining data/log4c-1.2.4/src/log4c/layout_type_basic.h Examining data/log4c-1.2.4/src/log4c/appender_type_rollingfile.h Examining data/log4c-1.2.4/src/log4c/appender_type_stream2.c Examining data/log4c-1.2.4/src/log4c/category.h Examining data/log4c-1.2.4/src/log4c/layout_type_dated_local_r.h Examining data/log4c-1.2.4/src/log4c/appender_type_stream.c Examining data/log4c-1.2.4/src/log4c/priority.c Examining data/log4c-1.2.4/src/log4c/appender_type_mmap.c Examining data/log4c-1.2.4/src/log4c/appender_type_stream2.h Examining data/log4c-1.2.4/src/log4c/layout.c Examining data/log4c-1.2.4/src/log4c/location_info.h Examining data/log4c-1.2.4/src/log4c/layout_type_dated_r.c Examining data/log4c-1.2.4/src/sd/domnode-xml-scanner.c Examining data/log4c-1.2.4/src/sd/sprintf.h Examining data/log4c-1.2.4/src/sd/test.h Examining data/log4c-1.2.4/src/sd/hash.c Examining data/log4c-1.2.4/src/sd/factory.c Examining data/log4c-1.2.4/src/sd/domnode-xml.c Examining data/log4c-1.2.4/src/sd/defs.h Examining data/log4c-1.2.4/src/sd/domnode.c Examining data/log4c-1.2.4/src/sd/sprintf.osf.c Examining data/log4c-1.2.4/src/sd/error.h Examining data/log4c-1.2.4/src/sd/sd_xplatform.c Examining data/log4c-1.2.4/src/sd/malloc.h Examining data/log4c-1.2.4/src/sd/hash.h Examining data/log4c-1.2.4/src/sd/list.c Examining data/log4c-1.2.4/src/sd/sd_xplatform.h Examining data/log4c-1.2.4/src/sd/domnode-xml-parser.h Examining data/log4c-1.2.4/src/sd/factory.h Examining data/log4c-1.2.4/src/sd/domnode-expat.c Examining data/log4c-1.2.4/src/sd/error.c Examining data/log4c-1.2.4/src/sd/malloc.c Examining data/log4c-1.2.4/src/sd/stack.h Examining data/log4c-1.2.4/src/sd/sprintf.c Examining data/log4c-1.2.4/src/sd/domnode-xml-parser.c Examining data/log4c-1.2.4/src/sd/domnode.h Examining data/log4c-1.2.4/src/sd/stack.c Examining data/log4c-1.2.4/src/sd/list.h Examining data/log4c-1.2.4/src/sd/domnode-xml-scanner.h Examining data/log4c-1.2.4/src/sd/test.c Examining data/log4c-1.2.4/src/sd/domnode-xml.h Examining data/log4c-1.2.4/src/log4c.h Examining data/log4c-1.2.4/tests/log4c/test_rollingfile_appender_mt.c Examining data/log4c-1.2.4/tests/log4c/test_rollingfile_appender.c Examining data/log4c-1.2.4/tests/log4c/cpp_compile_test.cpp Examining data/log4c-1.2.4/tests/log4c/test_layout_r.c Examining data/log4c-1.2.4/tests/log4c/test_stream2.c Examining data/log4c-1.2.4/tests/log4c/bench.c Examining data/log4c-1.2.4/tests/log4c/test_category.c Examining data/log4c-1.2.4/tests/log4c/test_rc.c Examining data/log4c-1.2.4/tests/log4c/test_big.c Examining data/log4c-1.2.4/tests/log4c/bench_fwrite.c FINAL RESULTS: data/log4c-1.2.4/examples/application_3.h:10:25: [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. LOG4C_ATTRIBUTE((format(printf, 7, 8))) data/log4c-1.2.4/examples/example_formatters.c:38:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "[%s][LINE:%d][FILE:%s] %s", a_event->evt_category, data/log4c-1.2.4/examples/example_formatters.c:78:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "<logmessage><category>%s</category><message>%s</message></logmessage>", a_event->evt_category, a_event->evt_msg); data/log4c-1.2.4/examples/helloworld1/mylog.h:71:2: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(a_format, va); data/log4c-1.2.4/examples/userloc_formatter.c:42:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "[%s][HOST:%s][PID:%i][FILE:%s][LINE:%i][MSG:%s]", data/log4c-1.2.4/examples/userloc_formatter.c:50:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "[%s]::[FILE:%s][LINE:%i][MSG::%s]", data/log4c-1.2.4/src/log4c/appender_type_rollingfile.c:334:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( s, "%s%s%s", logdir, data/log4c-1.2.4/src/log4c/category.c:252:23: [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. if ( (n = (size_t)vsnprintf(message, evt.evt_buffer.buf_size, a_format, a_args)) data/log4c-1.2.4/src/log4c/category.h:369:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 3, 4))) data/log4c-1.2.4/src/log4c/category.h:392:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 4, 5))) data/log4c-1.2.4/src/log4c/category.h:415:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3))) data/log4c-1.2.4/src/log4c/category.h:435:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3))) data/log4c-1.2.4/src/log4c/category.h:455:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3))) data/log4c-1.2.4/src/log4c/category.h:475:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3))) data/log4c-1.2.4/src/log4c/category.h:495:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3))) data/log4c-1.2.4/src/log4c/category.h:515:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3))) data/log4c-1.2.4/src/log4c/category.h:535:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3))) data/log4c-1.2.4/src/log4c/category.h:555:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3))) data/log4c-1.2.4/src/log4c/category.h:575:38: [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. LOG4C_INLINE LOG4C_ATTRIBUTE((format(printf, 2, 3))) data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.c:354:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( s, "%s%s%s%s%s", swup->sw_logdir, data/log4c-1.2.4/src/sd/domnode-xml-parser.c:446:21: [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 YYFPRINTF fprintf data/log4c-1.2.4/src/sd/error.c:36: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. r += vfprintf(stderr, fmt, args); data/log4c-1.2.4/src/sd/error.c:53: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. r += vfprintf(stderr, fmt, args); data/log4c-1.2.4/src/sd/error.h:14:64: [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. extern int sd_debug(const char *fmt, ...) SD_ATTRIBUTE((format(printf, 1, 2))); data/log4c-1.2.4/src/sd/error.h:15:64: [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. extern int sd_error(const char *fmt, ...) SD_ATTRIBUTE((format(printf, 1, 2))); data/log4c-1.2.4/src/sd/malloc.c:138:10: [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 strcpy (sd_malloc (strlen (string) + 1), string); data/log4c-1.2.4/src/sd/sd_xplatform.c:34:20: [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 warn(a,b,c)fprintf(stderr,a,b,c) data/log4c-1.2.4/src/sd/sd_xplatform.c:166:8: [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. ret = vsnprintf(str, size, format, ap); data/log4c-1.2.4/src/sd/sd_xplatform.h:94:27: [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. #define SD_ACCESS_READ(a) access(a,R_OK) data/log4c-1.2.4/src/sd/sd_xplatform.h:108: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 sd_snprintf data/log4c-1.2.4/src/sd/sd_xplatform.h:109: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. #define vsnprintf sd_vsnprintf data/log4c-1.2.4/src/sd/sd_xplatform.h:110:87: [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. int sd_snprintf(char *str, size_t size, const char *format, ...) SD_ATTRIBUTE((format(printf, 3, 4))); data/log4c-1.2.4/src/sd/sd_xplatform.h:113: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 _snprintf data/log4c-1.2.4/src/sd/sd_xplatform.h:113: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/log4c-1.2.4/src/sd/sd_xplatform.h:114: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. #define vsnprintf _vsnprintf data/log4c-1.2.4/src/sd/sprintf.c:43:6: [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. n = vsnprintf(buffer, size, a_fmt, ap); data/log4c-1.2.4/src/sd/sprintf.c:61: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. # ifndef snprintf data/log4c-1.2.4/src/sd/sprintf.h:40:74: [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. extern int sd_fprintf(int fd, const char *fmt, ...) SD_ATTRIBUTE((format(printf, 2, 3))); data/log4c-1.2.4/src/sd/sprintf.h:45:70: [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. extern char* sd_sprintf(const char* a_fmt, ...) SD_ATTRIBUTE((format(printf, 1, 2))); data/log4c-1.2.4/src/sd/sprintf.h:53: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. extern int snprintf(char* str, size_t size, const char* fmt, ...) SD_ATTRIBUTE((format(printf, 3, 4))); data/log4c-1.2.4/src/sd/sprintf.h:53:88: [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. extern int snprintf(char* str, size_t size, const char* fmt, ...) SD_ATTRIBUTE((format(printf, 3, 4))); data/log4c-1.2.4/src/sd/sprintf.h:54: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. extern int vsnprintf(char* str, size_t size, const char* fmt, va_list arg); data/log4c-1.2.4/src/sd/sprintf.osf.c:10: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. extern int snprintf(char* s, size_t maxlen, const char* fmt, ...) data/log4c-1.2.4/src/sd/sprintf.osf.c:16:11: [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(s, maxlen, fmt, args); data/log4c-1.2.4/src/sd/sprintf.osf.c:23: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. extern int vsnprintf(char* s, size_t maxlen, const char* fmt, va_list args) data/log4c-1.2.4/src/sd/sprintf.osf.c:39:11: [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. len = vfprintf(&f, fmt, args); data/log4c-1.2.4/tests/log4c/bench.c:94:7: [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,USAGE); data/log4c-1.2.4/tests/log4c/bench.c:104:7: [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, USAGE); data/log4c-1.2.4/tests/log4c/bench_fwrite.c:29:28: [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 bench_log(args...) fprintf(stderr, args) data/log4c-1.2.4/tests/log4c/bench_fwrite.c:31:24: [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 bench_log(...) fprintf(stderr, __VA_ARGS__) data/log4c-1.2.4/tests/log4c/bench_fwrite.c:165:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(g_tmpbuf, "%s\n", msgbuf); data/log4c-1.2.4/tests/log4c/test_stream2.c:161:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(testlogname, "%s.log", sd_test_get_name(a_test)); data/log4c-1.2.4/tests/log4c/test_stream2.c:189:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(testlogname, "%s.1", sd_test_get_name(a_test)); data/log4c-1.2.4/src/log4c/init.c:130:4: [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. getenv("LOG4C_RCPATH") ? getenv("LOG4C_RCPATH") : LOG4C_RCPATH); data/log4c-1.2.4/src/log4c/init.c:130:29: [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. getenv("LOG4C_RCPATH") ? getenv("LOG4C_RCPATH") : LOG4C_RCPATH); data/log4c-1.2.4/src/log4c/init.c:132:4: [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. getenv("HOME") ? getenv("HOME") : ""); data/log4c-1.2.4/src/log4c/init.c:132: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. getenv("HOME") ? getenv("HOME") : ""); data/log4c-1.2.4/src/log4c/init.c:158:19: [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 ( (priority = getenv("LOG4C_PRIORITY")) != NULL){ data/log4c-1.2.4/src/log4c/init.c:165:19: [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 ( (appender = getenv("LOG4C_APPENDER")) != NULL){ data/log4c-1.2.4/src/log4c/init.c:185:9: [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( getenv("SD_DEBUG")){ data/log4c-1.2.4/src/log4c/init.c:279:9: [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( getenv("SD_DEBUG")){ data/log4c-1.2.4/src/sd/domnode-xml-parser.c:949:16: [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. __debug = getenv("SD_DEBUG"); data/log4c-1.2.4/src/sd/error.c:31:10: [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 (!getenv("SD_DEBUG")) data/log4c-1.2.4/src/sd/error.c:48:10: [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 (!getenv("SD_ERROR")) data/log4c-1.2.4/src/sd/sd_xplatform.h:61:26: [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. #define SD_GETOPT(a,b,c) getopt(a,b,c) data/log4c-1.2.4/tests/log4c/bench_fwrite.c:181:16: [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 ((c = getopt(argc, argv, "fn:wb:t:m:s:hp")) != -1) { data/log4c-1.2.4/examples/application_3.c:62: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 hostname[256]; data/log4c-1.2.4/examples/example_appenders.c:66: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). if ( (fp = fopen(log4c_appender_get_name(this), "a+")) == NULL) data/log4c-1.2.4/examples/example_formatters.c:33: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 buffer[4096]; data/log4c-1.2.4/examples/example_formatters.c:54: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 buffer[4096]; data/log4c-1.2.4/examples/example_formatters.c:73: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 buffer[4096]; data/log4c-1.2.4/examples/userloc_formatter.c:34: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 buffer[4096]; data/log4c-1.2.4/src/log4c/appender.c:239:24: [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 (!this->app_type->open) data/log4c-1.2.4/src/log4c/appender.c:242: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). if (this->app_type->open(this) == -1){ data/log4c-1.2.4/src/log4c/appender.h:48: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). int (*open) (log4c_appender_t*); data/log4c-1.2.4/src/log4c/appender_type_mmap.c:48: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). if ( (minfo->fd = open(minfo->name, O_RDWR, 0644)) == -1) { data/log4c-1.2.4/src/log4c/appender_type_mmap.c:121: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(minfo->ptr, msg, available); data/log4c-1.2.4/src/log4c/appender_type_mmap.c:127: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(minfo->ptr, msg, size); data/log4c-1.2.4/src/log4c/appender_type_rollingfile.c:309: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). if ( (*fpp = fopen(filename, "w+")) == NULL){ data/log4c-1.2.4/src/log4c/appender_type_stream.c:23: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). if ( (fp = fopen(log4c_appender_get_name(this), "w+")) == NULL) data/log4c-1.2.4/src/log4c/appender_type_stream2.c:61:13: [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 ( (fp = fopen(log4c_appender_get_name(this), "w+")) == NULL){ data/log4c-1.2.4/src/log4c/init.c:79: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 name[256]; data/log4c-1.2.4/src/log4c/layout_type_basic.c:22: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 buffer[1024]; data/log4c-1.2.4/src/log4c/layout_type_dated.c:27: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 buffer[1024]; data/log4c-1.2.4/src/log4c/layout_type_dated_local.c:27: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 buffer[1024]; data/log4c-1.2.4/src/log4c/rc.c:76: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). this->config.nocleanup = atoi(node->value); data/log4c-1.2.4/src/log4c/rc.c:95: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). this->config.debug = atoi(level->value); data/log4c-1.2.4/src/log4c/rc.c:100:35: [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). this->config.reread = atoi(node->value); data/log4c-1.2.4/src/log4c/rc.c:302:57: [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). sizewin_udata_set_max_num_files(sizewin_udatap, atoi(maxnum->value)); data/log4c-1.2.4/src/log4c/rc.c:306:57: [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). sizewin_udata_set_max_num_files(sizewin_udatap, atoi(maxnum->value)); data/log4c-1.2.4/src/log4c/rc.c:358: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). this->config.nocleanup = !atoi(node->value); data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.c:345: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 tmp[100]; data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.c:349:3: [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(tmp, "%ld", i); data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.c:393: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). if ( (*fpp = fopen(filename, "w+")) == NULL){ data/log4c-1.2.4/src/sd/domnode-expat.c:54: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 cdata[2048]; data/log4c-1.2.4/src/sd/domnode-expat.c:431: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). if ( (fp = fopen(afilename, "r")) == NULL) data/log4c-1.2.4/src/sd/domnode-expat.c:446: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). if ( (fp = fopen(afilename, "w")) == NULL) data/log4c-1.2.4/src/sd/domnode-xml-scanner.c:2320: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 yytext_r[YYLMAX]; data/log4c-1.2.4/src/sd/domnode.c:137: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). if ( (fp = fopen(a_filename, "r")) == 0) data/log4c-1.2.4/src/sd/domnode.c:152: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). if ( (fp = fopen(afilename, "w")) == 0) data/log4c-1.2.4/src/sd/test.c:30: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 in_filename[128]; data/log4c-1.2.4/src/sd/test.c:31: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 ref_filename[128]; data/log4c-1.2.4/src/sd/test.c:32: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 out_filename[128]; data/log4c-1.2.4/src/sd/test.c:60: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(&li, &tv, sizeof(FILETIME)); data/log4c-1.2.4/src/sd/test.c:103:19: [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). this->in = fopen(this->in_filename, "r"); data/log4c-1.2.4/src/sd/test.c:104:19: [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). this->out = fopen(this->out_filename, "w"); data/log4c-1.2.4/tests/log4c/bench.c:40: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(&li, &tv, sizeof(FILETIME)); data/log4c-1.2.4/tests/log4c/bench.c:112:21: [2] (integer) atol: 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). g_num_msgs = atol(argv[SD_OPTIND]); data/log4c-1.2.4/tests/log4c/bench.c:114:19: [2] (integer) atol: 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). g_msgsize = atol(argv[SD_OPTIND+1]); data/log4c-1.2.4/tests/log4c/bench_fwrite.c:72: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 g_tmpbuf[10*1024]; data/log4c-1.2.4/tests/log4c/bench_fwrite.c:89:14: [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). g_fp = fopen( g_outfilename, "w+"); data/log4c-1.2.4/tests/log4c/bench_fwrite.c:192: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). g_bufmode = atoi(optarg); data/log4c-1.2.4/tests/log4c/bench_fwrite.c:196:20: [2] (integer) atol: 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). g_num_msgs = atol(optarg); data/log4c-1.2.4/tests/log4c/bench_fwrite.c:200:22: [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). g_numthreads = atoi(optarg); data/log4c-1.2.4/tests/log4c/bench_fwrite.c:213:19: [2] (integer) atol: 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). g_msgsize = atol(optarg); data/log4c-1.2.4/tests/log4c/bench_fwrite.c:217:21: [2] (integer) atol: 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). g_mybufsize = atol(optarg); data/log4c-1.2.4/tests/log4c/test_big.c:46: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("/dev/null", "w+"); data/log4c-1.2.4/tests/log4c/test_category.c:52: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 buffer[1024]; data/log4c-1.2.4/tests/log4c/test_rollingfile_appender_mt.c:89: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(&li, &tv, sizeof(FILETIME)); data/log4c-1.2.4/tests/log4c/test_rollingfile_appender_mt.c:224: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[1024]; data/log4c-1.2.4/tests/log4c/test_stream2.c:157: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 testlogname[1024]; data/log4c-1.2.4/tests/log4c/test_stream2.c:185: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 testlogname[1024]; data/log4c-1.2.4/src/log4c/appender_type_mmap.c:117: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). size = strlen(a_event->evt_rendered_msg); data/log4c-1.2.4/src/log4c/appender_type_rollingfile.c:149: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(a_event->evt_rendered_msg), rfup->rfu_current_file_size); data/log4c-1.2.4/src/log4c/appender_type_rollingfile.c:167: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). rfup->rfu_current_file_size += strlen(a_event->evt_rendered_msg); data/log4c-1.2.4/src/log4c/appender_type_rollingfile.c:330: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). filename_len = strlen(logdir) + 1 + data/log4c-1.2.4/src/log4c/appender_type_rollingfile.c:331:5: [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(prefix) + 1 + 10; /* a margin */ data/log4c-1.2.4/src/log4c/priority.c:48: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). if (!strncasecmp(priorities[i], a_priority_name, strlen(priorities[i]))) data/log4c-1.2.4/src/log4c/rc.c:39: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). size_t sz = strlen (astring); data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.c:85: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(a_event->evt_rendered_msg); data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.c:350: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). filename_len = strlen(swup->sw_logdir) + 1 + data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.c:351:5: [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(swup->sw_files_prefix) + 1 + data/log4c-1.2.4/src/log4c/rollingpolicy_type_sizewin.c:352:5: [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(tmp) + 1 + 10; /* a margin */ data/log4c-1.2.4/src/sd/domnode-expat.c:120:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&this->cdata[this->wptr], s, len); data/log4c-1.2.4/src/sd/domnode-xml-parser.c:485: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). # define yystrlen strlen data/log4c-1.2.4/src/sd/domnode-xml-scanner.c:2230:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, &s[k], i - k); data/log4c-1.2.4/src/sd/domnode-xml-scanner.c:2261:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, &s[k], i - k); data/log4c-1.2.4/src/sd/domnode-xml-scanner.c:2498:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ data/log4c-1.2.4/src/sd/domnode-xml-scanner.h:635:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ data/log4c-1.2.4/src/sd/malloc.c:138: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). return strcpy (sd_malloc (strlen (string) + 1), string); data/log4c-1.2.4/src/sd/test.c:90: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). if (strlen(this->name) > 4) { data/log4c-1.2.4/src/sd/test.c:91: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). ptr = this->name + strlen(this->name) - 4; data/log4c-1.2.4/tests/log4c/test_category.c:54:62: [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). snprintf(buffer, sizeof(buffer), "logging %lu bytes.\n", strlen(a_event->evt_msg)); data/log4c-1.2.4/tests/log4c/test_rollingfile_appender_mt.c:238: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). snprintf(&buf[strlen(buf)], 1024-strlen(buf), "%d", tid); data/log4c-1.2.4/tests/log4c/test_rollingfile_appender_mt.c:238: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). snprintf(&buf[strlen(buf)], 1024-strlen(buf), "%d", tid); ANALYSIS SUMMARY: Hits = 145 Lines analyzed = 18643 in approximately 0.58 seconds (32377 lines/second) Physical Source Lines of Code (SLOC) = 11594 Hits@level = [0] 138 [1] 23 [2] 56 [3] 13 [4] 53 [5] 0 Hits@level+ = [0+] 283 [1+] 145 [2+] 122 [3+] 66 [4+] 53 [5+] 0 Hits/KSLOC@level+ = [0+] 24.4092 [1+] 12.5065 [2+] 10.5227 [3+] 5.6926 [4+] 4.57133 [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.