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/udunits-2.2.26/prog/udunits2.c Examining data/udunits-2.2.26/prog/XGetopt.h Examining data/udunits-2.2.26/prog/XGetopt.c Examining data/udunits-2.2.26/lib/idToUnitMap.c Examining data/udunits-2.2.26/lib/scanner.c Examining data/udunits-2.2.26/lib/prefix.c Examining data/udunits-2.2.26/lib/status.c Examining data/udunits-2.2.26/lib/converter.h Examining data/udunits-2.2.26/lib/converter.c Examining data/udunits-2.2.26/lib/idToUnitMap.h Examining data/udunits-2.2.26/lib/error.c Examining data/udunits-2.2.26/lib/unitToIdMap.c Examining data/udunits-2.2.26/lib/udunits.h Examining data/udunits-2.2.26/lib/xml.c Examining data/udunits-2.2.26/lib/unitAndId.h Examining data/udunits-2.2.26/lib/formatter.c Examining data/udunits-2.2.26/lib/tsearch.h Examining data/udunits-2.2.26/lib/testUnits-1.c Examining data/udunits-2.2.26/lib/udunits-1.c Examining data/udunits-2.2.26/lib/c99_snprintf.c Examining data/udunits-2.2.26/lib/unitcore.c Examining data/udunits-2.2.26/lib/tsearch.c Examining data/udunits-2.2.26/lib/unitToIdMap.h Examining data/udunits-2.2.26/lib/testUnits.c Examining data/udunits-2.2.26/lib/parser.c Examining data/udunits-2.2.26/lib/udunits2.h Examining data/udunits-2.2.26/lib/ut_free_system.c Examining data/udunits-2.2.26/lib/systemMap.h Examining data/udunits-2.2.26/lib/unitAndId.c Examining data/udunits-2.2.26/lib/systemMap.c Examining data/udunits-2.2.26/lib/prefix.h FINAL RESULTS: data/udunits-2.2.26/lib/error.c:42:18: [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. int nbytes = vfprintf(stderr, fmt, args); data/udunits-2.2.26/lib/formatter.c:883: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. n = snprintf(buf, size, needParens ? "(%.*g " : "%.*g ", DBL_DIG, data/udunits-2.2.26/lib/formatter.c:1059:11: [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. n = snprintf(buf+nchar, size, data/udunits-2.2.26/lib/formatter.c:1077:11: [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. n = snprintf(buf+nchar, size, data/udunits-2.2.26/lib/formatter.c:1222:14: [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. nchar = snprintf(buf, size, data/udunits-2.2.26/lib/idToUnitMap.c:270:39: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. (IdToUnitMap**)smSearch(*systemMap, system); data/udunits-2.2.26/lib/idToUnitMap.c:308:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system) data/udunits-2.2.26/lib/idToUnitMap.c:317:39: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. (IdToUnitMap**)smFind(systemMap, system); data/udunits-2.2.26/lib/idToUnitMap.c:371:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system, data/udunits-2.2.26/lib/idToUnitMap.c:375:53: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_set_status(unmapId(systemToNameToUnit, name, system)); data/udunits-2.2.26/lib/idToUnitMap.c:423:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system, data/udunits-2.2.26/lib/idToUnitMap.c:427:57: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_set_status(unmapId(systemToSymbolToUnit, symbol, system)); data/udunits-2.2.26/lib/idToUnitMap.c:450:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system, data/udunits-2.2.26/lib/idToUnitMap.c:465:39: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. (IdToUnitMap**)smFind(systemMap, system); data/udunits-2.2.26/lib/idToUnitMap.c:497:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system, data/udunits-2.2.26/lib/idToUnitMap.c:502:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return getUnitById(systemToNameToUnit, system, name); data/udunits-2.2.26/lib/idToUnitMap.c:525:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system, data/udunits-2.2.26/lib/idToUnitMap.c:530:46: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return getUnitById(systemToSymbolToUnit, system, symbol); data/udunits-2.2.26/lib/idToUnitMap.c:543:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system) data/udunits-2.2.26/lib/idToUnitMap.c:545:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system != NULL) { data/udunits-2.2.26/lib/idToUnitMap.c:555:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. (IdToUnitMap**)smFind(systemMaps[i], system); data/udunits-2.2.26/lib/idToUnitMap.c:560:27: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. smRemove(systemMaps[i], system); data/udunits-2.2.26/lib/idToUnitMap.h:28:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system); data/udunits-2.2.26/lib/parser.c:873: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/udunits-2.2.26/lib/parser.c:2310:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system, data/udunits-2.2.26/lib/parser.c:2336:39: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. _unitSystem = (ut_system*)system; data/udunits-2.2.26/lib/prefix.c:273:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/prefix.c:300:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. (PrefixToValueMap**)smSearch(*systemMap, system); data/udunits-2.2.26/lib/prefix.c:349:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/prefix.c:353:29: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_set_status(addPrefix(system, name, value, &systemToNameToValue, data/udunits-2.2.26/lib/prefix.c:378:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/prefix.c:382:29: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_set_status(addPrefix(system, symbol, value, &systemToSymbolToValue, data/udunits-2.2.26/lib/prefix.c:414:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/prefix.c:433:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. (PrefixToValueMap**)smFind(systemMap, system); data/udunits-2.2.26/lib/prefix.c:479:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/prefix.c:487:19: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. : findPrefix(system, systemToNameToValue, string, value, len); data/udunits-2.2.26/lib/prefix.c:509:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/prefix.c:517:19: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. : findPrefix(system, systemToSymbolToValue, string, value, len); data/udunits-2.2.26/lib/prefix.h:31:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/prefix.h:53:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/prefix.h:75:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/prefix.h:98:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/scanner.c:981:11: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. (void)sscanf(text, format, &year, &month, &day); data/udunits-2.2.26/lib/scanner.c:1002:11: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. (void)sscanf(text, format, &hour, &minute, &second); data/udunits-2.2.26/lib/systemMap.c:35:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* system; data/udunits-2.2.26/lib/systemMap.c:56:56: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system1 = ((Entry*)entry1)->system; data/udunits-2.2.26/lib/systemMap.c:57:56: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system2 = ((Entry*)entry2)->system; data/udunits-2.2.26/lib/systemMap.c:97:24: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const void* const system) data/udunits-2.2.26/lib/systemMap.c:102:26: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. targetEntry.system = system; data/udunits-2.2.26/lib/systemMap.c:127:18: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const void* system) data/udunits-2.2.26/lib/systemMap.c:135:24: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. targetEntry->system = system; data/udunits-2.2.26/lib/systemMap.c:164:23: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const void* const system) data/udunits-2.2.26/lib/systemMap.c:169:26: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. targetEntry.system = system; data/udunits-2.2.26/lib/systemMap.h:46:24: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const void* const system); data/udunits-2.2.26/lib/systemMap.h:64:18: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const void* system); data/udunits-2.2.26/lib/systemMap.h:77:23: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const void* const system); data/udunits-2.2.26/lib/testUnits.c:93:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. CU_ASSERT_PTR_NOT_NULL(system); data/udunits-2.2.26/lib/testUnits.c:95:29: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. unit = ut_new_base_unit(system); data/udunits-2.2.26/lib/testUnits.c:99:42: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. unit = ut_get_dimensionless_unit_one(system); data/udunits-2.2.26/lib/testUnits.c:104:20: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_free_system(system); data/udunits-2.2.26/lib/testUnits.c:1049:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system; data/udunits-2.2.26/lib/testUnits.c:1059:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. CU_ASSERT_PTR_NOT_NULL(system); data/udunits-2.2.26/lib/testUnits.c:1061:73: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. CU_ASSERT_EQUAL(ut_same_system(meter, ut_get_dimensionless_unit_one(system)), 0); data/udunits-2.2.26/lib/testUnits.c:1063:20: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_free_system(system); data/udunits-2.2.26/lib/udunits.h:17: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/udunits-2.2.26/lib/udunits.h:17: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/udunits-2.2.26/lib/udunits2.h:34: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/udunits-2.2.26/lib/udunits2.h:275:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system); data/udunits-2.2.26/lib/udunits2.h:308:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system); data/udunits-2.2.26/lib/udunits2.h:329:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system, data/udunits-2.2.26/lib/udunits2.h:352:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system, data/udunits-2.2.26/lib/udunits2.h:396:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/udunits2.h:419:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/udunits2.h:445:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system); data/udunits-2.2.26/lib/udunits2.h:466:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system); data/udunits-2.2.26/lib/udunits2.h:561:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system, data/udunits-2.2.26/lib/udunits2.h:667:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system, data/udunits-2.2.26/lib/udunits2.h:1093:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system, data/udunits-2.2.26/lib/unitToIdMap.c:800:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system) data/udunits-2.2.26/lib/unitToIdMap.c:802:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system != NULL) { data/udunits-2.2.26/lib/unitToIdMap.c:812:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. (UnitToIdMap**)smFind(systemMaps[i], system); data/udunits-2.2.26/lib/unitToIdMap.c:817:27: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. smRemove(systemMaps[i], system); data/udunits-2.2.26/lib/unitToIdMap.h:25:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system); data/udunits-2.2.26/lib/unitcore.c:151:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system; data/udunits-2.2.26/lib/unitcore.c:220:23: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/unitcore.c:564:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system, data/udunits-2.2.26/lib/unitcore.c:567:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. assert(system != NULL); data/udunits-2.2.26/lib/unitcore.c:571:34: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. common->system = (ut_system*)system; data/udunits-2.2.26/lib/unitcore.c:604:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/unitcore.c:614:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. assert(system != NULL); data/udunits-2.2.26/lib/unitcore.c:616:26: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. product = productNew(system, &shortIndex, &power, 1); data/udunits-2.2.26/lib/unitcore.c:633:53: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (commonInit(&basicUnit->common, &basicOps, system, data/udunits-2.2.26/lib/unitcore.c:665:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return (ut_unit*)basicNew(unit->common.system, unit->basic.isDimensionless, data/udunits-2.2.26/lib/unitcore.c:884:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/unitcore.c:891:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. assert(system != NULL); data/udunits-2.2.26/lib/unitcore.c:907:52: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (commonInit(&productUnit->common, &productOps, system, PRODUCT) data/udunits-2.2.26/lib/unitcore.c:970:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. clone = (ut_unit*)productNew(unit->common.system, data/udunits-2.2.26/lib/unitcore.c:1150:51: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. result = (ut_unit*)productNew(unit1->common.system, data/udunits-2.2.26/lib/unitcore.c:1211:56: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. result = (ut_unit*)productNew(unit->common.system, data/udunits-2.2.26/lib/unitcore.c:1292:60: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. result = (ut_unit*)productNew(unit->common.system, data/udunits-2.2.26/lib/unitcore.c:1396:48: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system = unit1->common.system; data/udunits-2.2.26/lib/unitcore.c:1547:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system; data/udunits-2.2.26/lib/unitcore.c:1555:27: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system = unit->common.system; data/udunits-2.2.26/lib/unitcore.c:1622:20: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. unit->common.system, GALILEAN) == 0) { data/udunits-2.2.26/lib/unitcore.c:2054:20: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. unit->common.system, TIMESTAMP) == 0) { data/udunits-2.2.26/lib/unitcore.c:2375:62: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (commonInit(&logUnit->common, &logOps, reference->common.system, data/udunits-2.2.26/lib/unitcore.c:2747:37: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system->one = (ut_unit*)productNew(system, NULL, NULL, 0); data/udunits-2.2.26/lib/unitcore.c:2752:11: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. free(system); data/udunits-2.2.26/lib/unitcore.c:2757:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return system; data/udunits-2.2.26/lib/unitcore.c:2769:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system) data/udunits-2.2.26/lib/unitcore.c:2771:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system != NULL) { data/udunits-2.2.26/lib/unitcore.c:2785:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. free(system); data/udunits-2.2.26/lib/unitcore.c:2805:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const ut_system* const system) data/udunits-2.2.26/lib/unitcore.c:2839:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system; data/udunits-2.2.26/lib/unitcore.c:2849:24: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system = unit->common.system; data/udunits-2.2.26/lib/unitcore.c:2852:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return system; data/udunits-2.2.26/lib/unitcore.c:2883:53: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. sameSystem = unit1->common.system == unit2->common.system; data/udunits-2.2.26/lib/unitcore.c:2905:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system, data/udunits-2.2.26/lib/unitcore.c:2915:23: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. basicUnit = basicNew(system, isDimensionless, system->basicCount); data/udunits-2.2.26/lib/unitcore.c:2975:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system) data/udunits-2.2.26/lib/unitcore.c:2977:41: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. BasicUnit* basicUnit = newBasicUnit(system, 0); data/udunits-2.2.26/lib/unitcore.c:3001:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* const system) data/udunits-2.2.26/lib/unitcore.c:3003:35: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return (ut_unit*)newBasicUnit(system, 1); data/udunits-2.2.26/lib/unitcore.c:3032:37: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system = second->common.system; data/udunits-2.2.26/lib/unitcore.c:3080:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (unit1->common.system < unit2->common.system) { data/udunits-2.2.26/lib/unitcore.c:3080:51: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (unit1->common.system < unit2->common.system) { data/udunits-2.2.26/lib/unitcore.c:3083:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (unit1->common.system > unit2->common.system) { data/udunits-2.2.26/lib/unitcore.c:3083:51: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (unit1->common.system > unit2->common.system) { data/udunits-2.2.26/lib/unitcore.c:3257:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (unit1->common.system != unit2->common.system) { data/udunits-2.2.26/lib/unitcore.c:3257:52: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (unit1->common.system != unit2->common.system) { data/udunits-2.2.26/lib/unitcore.c:3325:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (numer->common.system != denom->common.system) { data/udunits-2.2.26/lib/unitcore.c:3325:52: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (numer->common.system != denom->common.system) { data/udunits-2.2.26/lib/unitcore.c:3526:28: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (unit1->common.system != unit2->common.system) { data/udunits-2.2.26/lib/unitcore.c:3526:52: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (unit1->common.system != unit2->common.system) { data/udunits-2.2.26/lib/unitcore.c:3584:27: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (from->common.system != to->common.system) { data/udunits-2.2.26/lib/unitcore.c:3584:48: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. else if (from->common.system != to->common.system) { data/udunits-2.2.26/lib/ut_free_system.c:19:39: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. extern void coreFreeSystem(ut_system* system); data/udunits-2.2.26/lib/ut_free_system.c:32:16: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. ut_system* system) data/udunits-2.2.26/lib/ut_free_system.c:34:9: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system != NULL) { data/udunits-2.2.26/lib/ut_free_system.c:35:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. itumFreeSystem(system); data/udunits-2.2.26/lib/ut_free_system.c:36:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. utimFreeSystem(system); data/udunits-2.2.26/lib/ut_free_system.c:37:17: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. coreFreeSystem(system); data/udunits-2.2.26/lib/xml.c:128:12: [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). (void)strcpy(buf, singular); data/udunits-2.2.26/lib/xml.c:397:15: [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). (void)strcpy(nonNbsp, latin1); data/udunits-2.2.26/lib/xml.c:436:15: [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). (void)strcpy(nonNbsp, utf8); data/udunits-2.2.26/lib/xml.c:484:19: [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). (void)strcpy(ids->ascii, id); data/udunits-2.2.26/lib/xml.c:1803:15: [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. (void)snprintf(buf, sizeof(buf), data/udunits-2.2.26/lib/xml.c:2092:19: [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). (void)strcpy(tmp, path); data/udunits-2.2.26/prog/udunits2.c:103:15: [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. (void)vfprintf(stderr, format, ap); data/udunits-2.2.26/prog/udunits2.c:124:11: [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). (void)strcpy(_progname, filename); data/udunits-2.2.26/prog/udunits2.c:136:19: [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). (void)strcpy(_progname, m_fname); data/udunits-2.2.26/prog/udunits2.c:606:13: [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)printf( data/udunits-2.2.26/prog/udunits2.c:615:27: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. (void)sprintf(haveExp, data/udunits-2.2.26/prog/udunits2.c:625:31: [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)printf( data/udunits-2.2.26/lib/testUnits.c:2178:42: [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. CU_ASSERT_EQUAL(ut_get_status(), getenv("UDUNITS2_XML_PATH") == NULL data/udunits-2.2.26/lib/testUnits.c:2292:15: [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("UDUNITS2_XML_PATH"); data/udunits-2.2.26/lib/xml.c:2139:13: [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. path = getenv("UDUNITS2_XML_PATH"); data/udunits-2.2.26/prog/XGetopt.c:150:5: [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. int getopt(int argc, TCHAR *argv[], TCHAR *optstring) data/udunits-2.2.26/prog/XGetopt.h:38:5: [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. int getopt(int argc, TCHAR *argv[], TCHAR *optstring); data/udunits-2.2.26/prog/udunits2.c:143:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "ALUhrH:W:")) != -1) { data/udunits-2.2.26/prog/udunits2.c:334:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. setEncoding(getenv("LC_ALL")); data/udunits-2.2.26/prog/udunits2.c:337:18: [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. setEncoding(getenv("LC_CTYPE")); data/udunits-2.2.26/prog/udunits2.c:340:15: [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. setEncoding(getenv("LANG")); data/udunits-2.2.26/lib/converter.c:900:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmpBuf[132]; data/udunits-2.2.26/lib/formatter.c:1202: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 refSpec[512]; data/udunits-2.2.26/lib/parser.c:1170: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/udunits-2.2.26/lib/parser.c:1187: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 yyformat[sizeof yyunexpected data/udunits-2.2.26/lib/parser.c:1355: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 yymsgbuf[128]; data/udunits-2.2.26/lib/scanner.c:1592: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). yylval.ival = atol((char*)uttext); data/udunits-2.2.26/lib/testUnits.c:91: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[80]; data/udunits-2.2.26/lib/testUnits.c:302: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[80]; data/udunits-2.2.26/lib/testUnits.c:340: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[80]; data/udunits-2.2.26/lib/testUnits.c:415: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[80]; data/udunits-2.2.26/lib/testUnits.c:520: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[80]; data/udunits-2.2.26/lib/testUnits.c:610: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[80]; data/udunits-2.2.26/lib/testUnits.c:693: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[80]; data/udunits-2.2.26/lib/testUnits.c:804: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[80]; data/udunits-2.2.26/lib/testUnits.c:917: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[80]; data/udunits-2.2.26/lib/testUnits.c:1451: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[80]; data/udunits-2.2.26/lib/testUnits.c:1668: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[80]; data/udunits-2.2.26/lib/testUnits.c:2272: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 actual[128]; data/udunits-2.2.26/lib/udunits.h:19:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define open _open data/udunits-2.2.26/lib/udunits2.h:25:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define open _open data/udunits-2.2.26/lib/unitcore.c:929:44: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. productUnit->indexes = memcpy(newIndexes, indexes, nbytes); data/udunits-2.2.26/lib/unitcore.c:930:43: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. productUnit->powers = memcpy(newPowers, powers, nbytes); data/udunits-2.2.26/lib/unitcore.c:1275: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[80]; data/udunits-2.2.26/lib/xml.c:66: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 singular[NAME_SIZE]; data/udunits-2.2.26/lib/xml.c:67: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 plural[NAME_SIZE]; data/udunits-2.2.26/lib/xml.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 symbol[NAME_SIZE]; data/udunits-2.2.26/lib/xml.c:87: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 ascii[NAME_SIZE]; data/udunits-2.2.26/lib/xml.c:88: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 latin1[NAME_SIZE]; data/udunits-2.2.26/lib/xml.c:89: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 latin1Nbsp[NAME_SIZE]; data/udunits-2.2.26/lib/xml.c:90: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 utf8[NAME_SIZE]; data/udunits-2.2.26/lib/xml.c:91: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 utf8Nbsp[NAME_SIZE]; data/udunits-2.2.26/lib/xml.c:116:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[NAME_SIZE]; data/udunits-2.2.26/lib/xml.c:145:10: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. (void)strcpy(buf+length-1, "ies"); data/udunits-2.2.26/lib/xml.c:153:10: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. (void)strcpy(buf+length, "es"); data/udunits-2.2.26/lib/xml.c:677:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/udunits-2.2.26/lib/xml.c:717: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[128]; data/udunits-2.2.26/lib/xml.c:1796: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[_XOPEN_PATH_MAX]; data/udunits-2.2.26/lib/xml.c:1998:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file.fd = open(path, O_RDONLY); data/udunits-2.2.26/lib/xml.c:2015:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUFSIZ]; /* from <stdio.h> */ data/udunits-2.2.26/lib/xml.c:2079: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 base[_XOPEN_PATH_MAX]; data/udunits-2.2.26/lib/xml.c:2082:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char drive[_MAX_DRIVE+1]; // Will have trailing colon data/udunits-2.2.26/lib/xml.c:2083:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char directory[_MAX_DIR+1]; // Will have trailing backslash data/udunits-2.2.26/lib/xml.c:2091:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[strlen(path)+1]; data/udunits-2.2.26/prog/udunits2.c:50:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char _progname[1024]; data/udunits-2.2.26/prog/udunits2.c:54:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char _haveUnitSpec[_POSIX_MAX_INPUT+1]; /* "have" unit minus data/udunits-2.2.26/prog/udunits2.c:56:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char _wantSpec[_POSIX_MAX_INPUT+1]; /* complete "want" unit data/udunits-2.2.26/prog/udunits2.c:134:19: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. (void)strcpy(_progname, "udunits2"); data/udunits-2.2.26/prog/udunits2.c:480:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[sizeof(_haveUnitSpec)]; data/udunits-2.2.26/prog/udunits2.c:573: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[256]; data/udunits-2.2.26/prog/udunits2.c:599: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 haveExp[_POSIX_MAX_INPUT+1]; data/udunits-2.2.26/prog/udunits2.c:600: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 exp[_POSIX_MAX_INPUT+1]; data/udunits-2.2.26/lib/converter.c:119:30: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (string[0] != '(' || string[strlen(string)-1] != ')'); data/udunits-2.2.26/lib/converter.c:911:12: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(tmpBuf, buf, sizeof(tmpBuf)); data/udunits-2.2.26/lib/formatter.c:815:8: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. (void)strncpy(formatPar->buf, "1", formatPar->size); data/udunits-2.2.26/lib/parser.c:181: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). for (stop = start + strlen(start); stop > start; --stop) data/udunits-2.2.26/lib/parser.c:1051: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/udunits-2.2.26/lib/parser.c:2249: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). size = 2 * strlen(latin1String) + 1; data/udunits-2.2.26/lib/parser.c:2351: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). if (n >= strlen(utf8String)) { data/udunits-2.2.26/lib/prefix.c:158: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). size_t len = strlen(id); data/udunits-2.2.26/lib/prefix.c:217:42: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (string != NULL && map != NULL && strlen(string) > 0) { data/udunits-2.2.26/lib/prefix.c:218: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). size_t len = strlen(string); data/udunits-2.2.26/lib/prefix.c:284:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (prefix == NULL || strlen(prefix) == 0) { data/udunits-2.2.26/lib/prefix.c:428:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). else if (string == NULL || strlen(string) == 0) { data/udunits-2.2.26/lib/scanner.c:1174:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( utin )) != EOF && c != '\n'; ++n ) \ data/udunits-2.2.26/lib/scanner.c:2504: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 ut_scan_bytes(yystr,strlen(yystr) ); data/udunits-2.2.26/lib/testUnits.c:329: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). CU_ASSERT_EQUAL(n, strlen(string)); data/udunits-2.2.26/lib/testUnits.c:330: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 (n != strlen(string)) data/udunits-2.2.26/lib/udunits.h:20:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define read _read data/udunits-2.2.26/lib/udunits2.h:24:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define read _read data/udunits-2.2.26/lib/xml.c:120: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). size_t length = strlen(singular); data/udunits-2.2.26/lib/xml.c:131:9: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. (void)strcpy(buf+length, "s"); data/udunits-2.2.26/lib/xml.c:142:10: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. (void)strcpy(buf+length, "s"); data/udunits-2.2.26/lib/xml.c:156:10: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. (void)strcpy(buf+length, "s"); data/udunits-2.2.26/lib/xml.c:194: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). size_t strLen = strlen(str); data/udunits-2.2.26/lib/xml.c:195:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t replLen = strlen(repl); data/udunits-2.2.26/lib/xml.c:202:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nbytes = strlen(in); data/udunits-2.2.26/lib/xml.c:210:19: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(out, in, nbytes); data/udunits-2.2.26/lib/xml.c:225:19: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(out, in, nbytes); data/udunits-2.2.26/lib/xml.c:229:19: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(out, repl, replLen); data/udunits-2.2.26/lib/xml.c:471: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(id) > NAME_SIZE - 1) { data/udunits-2.2.26/lib/xml.c:1528:15: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(currFile->singular, text, NAME_SIZE); data/udunits-2.2.26/lib/xml.c:1576:15: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(currFile->plural, text, NAME_SIZE); data/udunits-2.2.26/lib/xml.c:2017:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nbytes = read(file.fd, buf, sizeof(buf)); data/udunits-2.2.26/lib/xml.c:2091:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char tmp[strlen(path)+1]; data/udunits-2.2.26/lib/xml.c:2093:19: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(base, dirname(tmp), sizeof(base)); data/udunits-2.2.26/prog/udunits2.c:121: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(filename)+1 > sizeof(_progname)) data/udunits-2.2.26/prog/udunits2.c:127:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(argv[0]); data/udunits-2.2.26/prog/udunits2.c:133:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(m_fname)+1 > sizeof(_progname)) data/udunits-2.2.26/prog/udunits2.c:206: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). char* const copy = malloc(strlen(string)+1); data/udunits-2.2.26/prog/udunits2.c:413: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). nbytes = (int)strlen(spec); data/udunits-2.2.26/prog/udunits2.c:436:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(_haveUnitSpec, input, sizeof(_haveUnitSpec)); data/udunits-2.2.26/prog/udunits2.c:504: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). size_t nbytes = strlen(buf); data/udunits-2.2.26/prog/udunits2.c:540:19: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(_wantSpec, _cmdWant, sizeof(_wantSpec)); ANALYSIS SUMMARY: Hits = 256 Lines analyzed = 23147 in approximately 0.54 seconds (43241 lines/second) Physical Source Lines of Code (SLOC) = 14422 Hits@level = [0] 68 [1] 42 [2] 51 [3] 9 [4] 154 [5] 0 Hits@level+ = [0+] 324 [1+] 256 [2+] 214 [3+] 163 [4+] 154 [5+] 0 Hits/KSLOC@level+ = [0+] 22.4657 [1+] 17.7507 [2+] 14.8384 [3+] 11.3022 [4+] 10.6781 [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.