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/openexr-viewers-2.3.0/playexr/ImageBuffers.h Examining data/openexr-viewers-2.3.0/playexr/FileReadingThread.h Examining data/openexr-viewers-2.3.0/playexr/playExr.h Examining data/openexr-viewers-2.3.0/playexr/ImageBuffers.cpp Examining data/openexr-viewers-2.3.0/playexr/Timer.cpp Examining data/openexr-viewers-2.3.0/playexr/FileReadingThread.cpp Examining data/openexr-viewers-2.3.0/playexr/ctlToLut.h Examining data/openexr-viewers-2.3.0/playexr/osDependent.h Examining data/openexr-viewers-2.3.0/playexr/fileNameForFrame.h Examining data/openexr-viewers-2.3.0/playexr/Timer.h Examining data/openexr-viewers-2.3.0/playexr/playExr.cpp Examining data/openexr-viewers-2.3.0/playexr/fileNameForFrame.cpp Examining data/openexr-viewers-2.3.0/playexr/osDependent.cpp Examining data/openexr-viewers-2.3.0/playexr/main.cpp Examining data/openexr-viewers-2.3.0/playexr/ctlToLut.cpp Examining data/openexr-viewers-2.3.0/exrdisplay/applyCtl.h Examining data/openexr-viewers-2.3.0/exrdisplay/applyCtl.cpp Examining data/openexr-viewers-2.3.0/exrdisplay/GlWindow3d.h Examining data/openexr-viewers-2.3.0/exrdisplay/scaleImage.h Examining data/openexr-viewers-2.3.0/exrdisplay/ImageView.h Examining data/openexr-viewers-2.3.0/exrdisplay/ImageView.cpp Examining data/openexr-viewers-2.3.0/exrdisplay/namespaceAlias.h Examining data/openexr-viewers-2.3.0/exrdisplay/GlWindow3d.cpp Examining data/openexr-viewers-2.3.0/exrdisplay/loadImage.h Examining data/openexr-viewers-2.3.0/exrdisplay/loadImage.cpp Examining data/openexr-viewers-2.3.0/exrdisplay/scaleImage.cpp Examining data/openexr-viewers-2.3.0/exrdisplay/main.cpp FINAL RESULTS: data/openexr-viewers-2.3.0/exrdisplay/applyCtl.cpp:92: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. if (const char *gamma = getenv (gammaEnv)) data/openexr-viewers-2.3.0/exrdisplay/applyCtl.cpp:131:38: [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 (const char *chromaticities = getenv (chromaticitiesEnv)) data/openexr-viewers-2.3.0/exrdisplay/applyCtl.cpp:188:38: [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 (const char *whiteLuminance = getenv (whiteLuminanceEnv)) data/openexr-viewers-2.3.0/exrdisplay/applyCtl.cpp:215:41: [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 (const char *surroundLuminance = getenv (surroundLuminanceEnv)) data/openexr-viewers-2.3.0/exrdisplay/applyCtl.cpp:245:36: [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. const char *displayTransform = getenv (displayTransformEnv); data/openexr-viewers-2.3.0/playexr/ctlToLut.cpp:91: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. if (const char *gamma = getenv (gammaEnv)) data/openexr-viewers-2.3.0/playexr/ctlToLut.cpp:139:38: [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 (const char *chromaticities = getenv (chromaticitiesEnv)) data/openexr-viewers-2.3.0/playexr/ctlToLut.cpp:176:38: [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 (const char *whiteLuminance = getenv (whiteLuminanceEnv)) data/openexr-viewers-2.3.0/playexr/ctlToLut.cpp:203:41: [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 (const char *surroundLuminance = getenv (surroundLuminanceEnv)) data/openexr-viewers-2.3.0/playexr/ctlToLut.cpp:233:36: [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. const char *displayTransform = getenv (displayTransformEnv); data/openexr-viewers-2.3.0/playexr/ctlToLut.cpp:420:38: [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 (const char *chromaticities = getenv (chromaticitiesEnv)) data/openexr-viewers-2.3.0/exrdisplay/ImageView.cpp:356:28: [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 val_str[20]; data/openexr-viewers-2.3.0/exrdisplay/ImageView.cpp:357:21: [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 (val_str, "%.3lf", val); data/openexr-viewers-2.3.0/exrdisplay/ImageView.cpp:387: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 val_str[20]; data/openexr-viewers-2.3.0/exrdisplay/ImageView.cpp:388:5: [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 (val_str, "Zmax : %.3lf", _zmax); data/openexr-viewers-2.3.0/exrdisplay/ImageView.cpp:395: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 val_str1[20]; data/openexr-viewers-2.3.0/exrdisplay/ImageView.cpp:396:5: [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 (val_str1, "Zmin : %.3lf", _zmin); data/openexr-viewers-2.3.0/exrdisplay/ImageView.cpp:434:17: [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 (_rgbaBoxLabel, data/openexr-viewers-2.3.0/exrdisplay/ImageView.h:128: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 _rgbaBoxLabel[200]; data/openexr-viewers-2.3.0/playexr/ImageBuffers.h:162: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 * _pixels[NUM_BUFFERS][3]; data/openexr-viewers-2.3.0/exrdisplay/ImageView.cpp:440:17: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf (_rgbaBoxLabel, " "); ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 8147 in approximately 0.20 seconds (41090 lines/second) Physical Source Lines of Code (SLOC) = 4682 Hits@level = [0] 10 [1] 1 [2] 9 [3] 11 [4] 0 [5] 0 Hits@level+ = [0+] 31 [1+] 21 [2+] 20 [3+] 11 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 6.6211 [1+] 4.48526 [2+] 4.27168 [3+] 2.34942 [4+] 0 [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.