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/qosmic-1.6.0/src/adjustscenewidget.cpp Examining data/qosmic-1.6.0/src/adjustscenewidget.h Examining data/qosmic-1.6.0/src/basistriangle.cpp Examining data/qosmic-1.6.0/src/basistriangle.h Examining data/qosmic-1.6.0/src/camerasettingswidget.cpp Examining data/qosmic-1.6.0/src/camerasettingswidget.h Examining data/qosmic-1.6.0/src/chaoswidget.cpp Examining data/qosmic-1.6.0/src/chaoswidget.h Examining data/qosmic-1.6.0/src/checkersbrush.cpp Examining data/qosmic-1.6.0/src/checkersbrush.h Examining data/qosmic-1.6.0/src/colorbalancewidget.cpp Examining data/qosmic-1.6.0/src/colorbalancewidget.h Examining data/qosmic-1.6.0/src/colordialog.cpp Examining data/qosmic-1.6.0/src/colordialog.h Examining data/qosmic-1.6.0/src/colorlabel.cpp Examining data/qosmic-1.6.0/src/colorlabel.h Examining data/qosmic-1.6.0/src/colorselector.cpp Examining data/qosmic-1.6.0/src/colorselector.h Examining data/qosmic-1.6.0/src/colorsettingswidget.cpp Examining data/qosmic-1.6.0/src/colorsettingswidget.h Examining data/qosmic-1.6.0/src/coordinatemark.cpp Examining data/qosmic-1.6.0/src/coordinatemark.h Examining data/qosmic-1.6.0/src/directorylistview.cpp Examining data/qosmic-1.6.0/src/directorylistview.h Examining data/qosmic-1.6.0/src/directoryviewwidget.cpp Examining data/qosmic-1.6.0/src/directoryviewwidget.h Examining data/qosmic-1.6.0/src/doublevalueeditor.cpp Examining data/qosmic-1.6.0/src/doublevalueeditor.h Examining data/qosmic-1.6.0/src/editmodeselectorwidget.cpp Examining data/qosmic-1.6.0/src/editmodeselectorwidget.h Examining data/qosmic-1.6.0/src/flam3filestream.cpp Examining data/qosmic-1.6.0/src/flam3filestream.h Examining data/qosmic-1.6.0/src/flam3util.cpp Examining data/qosmic-1.6.0/src/flam3util.h Examining data/qosmic-1.6.0/src/flamfileiconprovider.cpp Examining data/qosmic-1.6.0/src/flamfileiconprovider.h Examining data/qosmic-1.6.0/src/genomecolorselector.cpp Examining data/qosmic-1.6.0/src/genomecolorselector.h Examining data/qosmic-1.6.0/src/genomevector.cpp Examining data/qosmic-1.6.0/src/genomevector.h Examining data/qosmic-1.6.0/src/genomevectorlistview.cpp Examining data/qosmic-1.6.0/src/genomevectorlistview.h Examining data/qosmic-1.6.0/src/gradientlistmodel.cpp Examining data/qosmic-1.6.0/src/gradientlistmodel.h Examining data/qosmic-1.6.0/src/gradientstopseditor.cpp Examining data/qosmic-1.6.0/src/gradientstopseditor.h Examining data/qosmic-1.6.0/src/imgsettingswidget.cpp Examining data/qosmic-1.6.0/src/imgsettingswidget.h Examining data/qosmic-1.6.0/src/intvalueeditor.cpp Examining data/qosmic-1.6.0/src/intvalueeditor.h Examining data/qosmic-1.6.0/src/logger.cpp Examining data/qosmic-1.6.0/src/logger.h Examining data/qosmic-1.6.0/src/lua/frame.cpp Examining data/qosmic-1.6.0/src/lua/frame.h Examining data/qosmic-1.6.0/src/lua/genome.cpp Examining data/qosmic-1.6.0/src/lua/genome.h Examining data/qosmic-1.6.0/src/lua/highlighter.cpp Examining data/qosmic-1.6.0/src/lua/highlighter.h Examining data/qosmic-1.6.0/src/lua/luaeditor.cpp Examining data/qosmic-1.6.0/src/lua/luaeditor.h Examining data/qosmic-1.6.0/src/lua/luathread.cpp Examining data/qosmic-1.6.0/src/lua/luathread.h Examining data/qosmic-1.6.0/src/lua/luathreadadapter.cpp Examining data/qosmic-1.6.0/src/lua/luathreadadapter.h Examining data/qosmic-1.6.0/src/lua/luatype.cpp Examining data/qosmic-1.6.0/src/lua/luatype.h Examining data/qosmic-1.6.0/src/lua/lunar.h Examining data/qosmic-1.6.0/src/lua/xform.cpp Examining data/qosmic-1.6.0/src/lua/xform.h Examining data/qosmic-1.6.0/src/mainpreviewwidget.cpp Examining data/qosmic-1.6.0/src/mainpreviewwidget.h Examining data/qosmic-1.6.0/src/mainviewer.cpp Examining data/qosmic-1.6.0/src/mainviewer.h Examining data/qosmic-1.6.0/src/mainwindow.h Examining data/qosmic-1.6.0/src/mutationwidget.cpp Examining data/qosmic-1.6.0/src/mutationwidget.h Examining data/qosmic-1.6.0/src/nodeitem.cpp Examining data/qosmic-1.6.0/src/nodeitem.h Examining data/qosmic-1.6.0/src/posttriangle.cpp Examining data/qosmic-1.6.0/src/posttriangle.h Examining data/qosmic-1.6.0/src/qosmic.cpp Examining data/qosmic-1.6.0/src/qosmic.h Examining data/qosmic-1.6.0/src/qosmicwidget.cpp Examining data/qosmic-1.6.0/src/qosmicwidget.h Examining data/qosmic-1.6.0/src/renderdialog.h Examining data/qosmic-1.6.0/src/renderprogressdialog.cpp Examining data/qosmic-1.6.0/src/renderprogressdialog.h Examining data/qosmic-1.6.0/src/renderthread.h Examining data/qosmic-1.6.0/src/scripteditwidget.cpp Examining data/qosmic-1.6.0/src/scripteditwidget.h Examining data/qosmic-1.6.0/src/selectgenomewidget.cpp Examining data/qosmic-1.6.0/src/selectgenomewidget.h Examining data/qosmic-1.6.0/src/selecttrianglewidget.cpp Examining data/qosmic-1.6.0/src/selecttrianglewidget.h Examining data/qosmic-1.6.0/src/sheeploopwidget.cpp Examining data/qosmic-1.6.0/src/sheeploopwidget.h Examining data/qosmic-1.6.0/src/snapslider.cpp Examining data/qosmic-1.6.0/src/snapslider.h Examining data/qosmic-1.6.0/src/statuswidget.cpp Examining data/qosmic-1.6.0/src/statuswidget.h Examining data/qosmic-1.6.0/src/transformablegraphicsguide.cpp Examining data/qosmic-1.6.0/src/transformablegraphicsguide.h Examining data/qosmic-1.6.0/src/transformablegraphicsitem.cpp Examining data/qosmic-1.6.0/src/transformablegraphicsitem.h Examining data/qosmic-1.6.0/src/triangle.cpp Examining data/qosmic-1.6.0/src/triangle.h Examining data/qosmic-1.6.0/src/trianglecoordswidget.cpp Examining data/qosmic-1.6.0/src/triangledensitywidget.cpp Examining data/qosmic-1.6.0/src/triangleselection.cpp Examining data/qosmic-1.6.0/src/triangleselection.h Examining data/qosmic-1.6.0/src/undoring.cpp Examining data/qosmic-1.6.0/src/undoring.h Examining data/qosmic-1.6.0/src/variationswidget.cpp Examining data/qosmic-1.6.0/src/variationswidget.h Examining data/qosmic-1.6.0/src/varstablewidget.cpp Examining data/qosmic-1.6.0/src/varstablewidget.h Examining data/qosmic-1.6.0/src/viewerpresetsmodel.cpp Examining data/qosmic-1.6.0/src/viewerpresetsmodel.h Examining data/qosmic-1.6.0/src/viewerpresetswidget.cpp Examining data/qosmic-1.6.0/src/viewerpresetswidget.h Examining data/qosmic-1.6.0/src/wheelvalueeditor.cpp Examining data/qosmic-1.6.0/src/wheelvalueeditor.h Examining data/qosmic-1.6.0/src/xfedit.cpp Examining data/qosmic-1.6.0/src/xfedit.h Examining data/qosmic-1.6.0/src/paletteeditor.h Examining data/qosmic-1.6.0/src/trianglecoordswidget.h Examining data/qosmic-1.6.0/src/triangledensitywidget.h Examining data/qosmic-1.6.0/src/renderdialog.cpp Examining data/qosmic-1.6.0/src/mainwindow.cpp Examining data/qosmic-1.6.0/src/paletteeditor.cpp Examining data/qosmic-1.6.0/src/renderthread.cpp FINAL RESULTS: data/qosmic-1.6.0/src/logger.cpp:172:20: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. << QString().vsprintf(msg, ap) data/qosmic-1.6.0/src/logger.cpp:186:20: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. << QString().vsprintf(msg, ap) data/qosmic-1.6.0/src/logger.cpp:200:20: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. << QString().vsprintf(msg, ap) data/qosmic-1.6.0/src/logger.cpp:214:20: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. << QString().vsprintf(msg, ap) data/qosmic-1.6.0/src/logger.cpp:228:20: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. << QString().vsprintf(msg, ap) data/qosmic-1.6.0/src/logger.cpp:242:20: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. << QString().vsprintf(msg, ap) data/qosmic-1.6.0/src/logger.cpp:256:20: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. << QString().vsprintf(msg, ap) data/qosmic-1.6.0/src/qosmic.cpp:39:51: [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. Logger::getInstance()->setLevel(Logger::levelFor(getenv("log"))); data/qosmic-1.6.0/src/qosmic.cpp:69:17: [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. .arg(QString(getenv("flam3_verbose")).toInt()) data/qosmic-1.6.0/src/qosmic.cpp:70:17: [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. .arg(QString(getenv("flam3_nthreads")).toInt() > 0 ? data/qosmic-1.6.0/src/qosmic.cpp:71: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. QString(getenv("flam3_nthreads")).toInt() : flam3_count_nthreads()) data/qosmic-1.6.0/src/renderthread.cpp:80:27: [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. flame.nthreads = QString(getenv("flam3_nthreads")).toInt(); data/qosmic-1.6.0/src/renderthread.cpp:81:27: [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. flame.verbose = QString(getenv("flam3_verbose")).toInt(); data/qosmic-1.6.0/src/flam3filestream.cpp:61: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). if (!m_file->open(QIODevice::ReadOnly)) data/qosmic-1.6.0/src/flam3filestream.cpp:103: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). if (!m_file->open(QIODevice::WriteOnly)) data/qosmic-1.6.0/src/flam3util.cpp:595: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(locale, lorig, slen); data/qosmic-1.6.0/src/lua/luaeditor.cpp:205:12: [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 (!file.open(QIODevice::ReadOnly)) data/qosmic-1.6.0/src/lua/luaeditor.cpp:237:12: [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 (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) data/qosmic-1.6.0/src/lua/lunar.h:196:4: [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 buff[32]; data/qosmic-1.6.0/src/lua/lunar.h:199:4: [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(buff, "%p", obj); data/qosmic-1.6.0/src/mainwindow.cpp:533:12: [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 (file.open(QIODevice::ReadOnly)) data/qosmic-1.6.0/src/mainwindow.cpp:565:18: [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). void MainWindow::open() data/qosmic-1.6.0/src/mainwindow.cpp:813:51: [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). connect(openAct, SIGNAL(triggered()), this, SLOT(open())); data/qosmic-1.6.0/src/mainwindow.h:88:8: [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). void open(); data/qosmic-1.6.0/src/mutationwidget.cpp:459:4: [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 modstr[flam3_max_action_length] = ""; data/qosmic-1.6.0/src/mutationwidget.cpp:490:4: [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 modstr[flam3_max_action_length] = ""; data/qosmic-1.6.0/src/paletteeditor.cpp:136:12: [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 (!data.open(QFile::ReadWrite)) data/qosmic-1.6.0/src/paletteeditor.cpp:642:12: [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 (!data.open(QFile::ReadOnly)) data/qosmic-1.6.0/src/paletteeditor.cpp:694:12: [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 (!data.open(QFile::ReadOnly)) data/qosmic-1.6.0/src/paletteeditor.cpp:909:12: [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 (!data.open(QFile::ReadOnly)) data/qosmic-1.6.0/src/paletteeditor.h:48:6: [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(pa, p, sizeof(flam3_palette)); data/qosmic-1.6.0/src/xfedit.cpp:327:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(genome_ptr->xform + n, xformClip.data(), sizeof(flam3_xform) * size); data/qosmic-1.6.0/src/flam3filestream.cpp:38:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool Flam3FileStream::read(GenomeVector* genomes) data/qosmic-1.6.0/src/flam3filestream.cpp:42:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(&in, &ncps)) data/qosmic-1.6.0/src/flam3filestream.cpp:54:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(&in, &ncps)) data/qosmic-1.6.0/src/flam3filestream.cpp:59:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool Flam3FileStream::read(flam3_genome** in, int* ncps) data/qosmic-1.6.0/src/flam3filestream.h:31:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(GenomeVector*); data/qosmic-1.6.0/src/flam3filestream.h:32:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(flam3_genome**, int*); data/qosmic-1.6.0/src/flam3util.cpp:592: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). int slen = strlen(lorig) + 1; data/qosmic-1.6.0/src/lua/luathreadadapter.cpp:91:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (s.read(&in, &ncps)) data/qosmic-1.6.0/src/mainwindow.cpp:1232:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (s.read(&genomes)) data/qosmic-1.6.0/src/mainwindow.cpp:1275:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (s.read(&in, &ncps)) data/qosmic-1.6.0/src/renderthread.cpp:138:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(10000); data/qosmic-1.6.0/src/renderthread.cpp:510:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(250000); ANALYSIS SUMMARY: Hits = 44 Lines analyzed = 28440 in approximately 0.68 seconds (41757 lines/second) Physical Source Lines of Code (SLOC) = 22303 Hits@level = [0] 2 [1] 12 [2] 19 [3] 6 [4] 7 [5] 0 Hits@level+ = [0+] 46 [1+] 44 [2+] 32 [3+] 13 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 2.0625 [1+] 1.97283 [2+] 1.43478 [3+] 0.582881 [4+] 0.313859 [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.