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/gpaint-0.3.3/src/about.c
Examining data/gpaint-0.3.3/src/about.h
Examining data/gpaint-0.3.3/src/brush.c
Examining data/gpaint-0.3.3/src/brush.h
Examining data/gpaint-0.3.3/src/callbacks.c
Examining data/gpaint-0.3.3/src/canvas.c
Examining data/gpaint-0.3.3/src/canvas.h
Examining data/gpaint-0.3.3/src/color_palette.h
Examining data/gpaint-0.3.3/src/debug.h
Examining data/gpaint-0.3.3/src/file.c
Examining data/gpaint-0.3.3/src/file.h
Examining data/gpaint-0.3.3/src/fill.c
Examining data/gpaint-0.3.3/src/fill.h
Examining data/gpaint-0.3.3/src/freehand.c
Examining data/gpaint-0.3.3/src/freehand.h
Examining data/gpaint-0.3.3/src/global.h
Examining data/gpaint-0.3.3/src/gtkscrollframe.c
Examining data/gpaint-0.3.3/src/gtkscrollframe.h
Examining data/gpaint-0.3.3/src/image_processing.c
Examining data/gpaint-0.3.3/src/image_processing.h
Examining data/gpaint-0.3.3/src/lasso.c
Examining data/gpaint-0.3.3/src/lasso.h
Examining data/gpaint-0.3.3/src/paste.c
Examining data/gpaint-0.3.3/src/paste.h
Examining data/gpaint-0.3.3/src/pen.c
Examining data/gpaint-0.3.3/src/pen.h
Examining data/gpaint-0.3.3/src/pixmaps.c
Examining data/gpaint-0.3.3/src/pixmaps.h
Examining data/gpaint-0.3.3/src/polyselect.c
Examining data/gpaint-0.3.3/src/polyselect.h
Examining data/gpaint-0.3.3/src/rectselect.c
Examining data/gpaint-0.3.3/src/rectselect.h
Examining data/gpaint-0.3.3/src/print.c
Examining data/gpaint-0.3.3/src/print.h
Examining data/gpaint-0.3.3/src/selection.c
Examining data/gpaint-0.3.3/src/selection.h
Examining data/gpaint-0.3.3/src/shape.c
Examining data/gpaint-0.3.3/src/shape.h
Examining data/gpaint-0.3.3/src/util.c
Examining data/gpaint-0.3.3/src/util.h
Examining data/gpaint-0.3.3/src/tool_palette.c
Examining data/gpaint-0.3.3/src/tool_palette.h
Examining data/gpaint-0.3.3/src/version.h
Examining data/gpaint-0.3.3/src/text.h
Examining data/gpaint-0.3.3/src/drawing.h
Examining data/gpaint-0.3.3/src/image.h
Examining data/gpaint-0.3.3/src/menu.c
Examining data/gpaint-0.3.3/src/drawing.c
Examining data/gpaint-0.3.3/src/callbacks.h
Examining data/gpaint-0.3.3/src/color_palette.c
Examining data/gpaint-0.3.3/src/image.c
Examining data/gpaint-0.3.3/src/text.c
Examining data/gpaint-0.3.3/src/main.c

FINAL RESULTS:

data/gpaint-0.3.3/src/image_processing.c:181:19:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
#define RANDOMI()	random()
data/gpaint-0.3.3/src/image_processing.c:182:35:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
#define RANDOMI2(s, f)	(((double)(random() % RANGE) / \
data/gpaint-0.3.3/src/image_processing.c:184:23:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
#define SRANDOM(seed)	srandom((unsigned) (seed))
data/gpaint-0.3.3/src/file.c:299: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 tmp[100];
data/gpaint-0.3.3/src/file.c:310: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(tmp, "%d", canvas->drawing->width);
data/gpaint-0.3.3/src/file.c:313: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(tmp, "%d", canvas->drawing->height);
data/gpaint-0.3.3/src/image.c:41:18:  [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.
        unsigned char *data, 
data/gpaint-0.3.3/src/image.c:44:18:  [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.
        unsigned char value[4], 
data/gpaint-0.3.3/src/image.c:45:18:  [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.
        unsigned char mask[4], 
data/gpaint-0.3.3/src/image.c:62: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.
  unsigned char value[4];
data/gpaint-0.3.3/src/image.c:63: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.
  unsigned char mask[4];
data/gpaint-0.3.3/src/image.c:318:14:  [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.
    unsigned char alphaonly[4] = {0, 0, 0, 1};
data/gpaint-0.3.3/src/image.c:320:14:  [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.
    unsigned char default_pixel[4] = {0, 0, 0, 255};
data/gpaint-0.3.3/src/image.c:410:18:  [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.
        unsigned char *data,
data/gpaint-0.3.3/src/image.c:413:18:  [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.
        unsigned char value[4], 
data/gpaint-0.3.3/src/image.c:414:18:  [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.
        unsigned char mask[4],
data/gpaint-0.3.3/src/image_processing.c:431: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.
    static unsigned char base[3] = { 128, 128, 128 };
data/gpaint-0.3.3/src/image_processing.c:601: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 (out, in, sizeof (unsigned char) * width * height * size);
data/gpaint-0.3.3/src/print.c:63: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(buf, image_pixels(image), size);
data/gpaint-0.3.3/src/selection.c:99: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(dst->array->data, src->array->data, sizeof(GdkPoint) * dst->array->len);
data/gpaint-0.3.3/src/canvas.c:912:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (g_ascii_strncasecmp (a_name, "bmp", strlen("bmp")) == 0)
data/gpaint-0.3.3/src/canvas.c:914:50:  [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 (g_ascii_strncasecmp (b_name, "bmp", strlen("bmp")) == 0)
data/gpaint-0.3.3/src/canvas.c:920:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (g_ascii_strncasecmp (a_name, "png", strlen("png")) == 0)
data/gpaint-0.3.3/src/canvas.c:922:50:  [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 (g_ascii_strncasecmp (b_name, "png", strlen("png")) == 0)
data/gpaint-0.3.3/src/canvas.c:926:51:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    else if (g_ascii_strncasecmp (a_name, "jpeg", strlen("jpeg")) == 0)
data/gpaint-0.3.3/src/canvas.c:928:51:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    else if (g_ascii_strncasecmp (b_name, "jpeg", strlen("jpeg")) == 0)
data/gpaint-0.3.3/src/canvas.c:932:50:  [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 (g_ascii_strncasecmp (a_name, "gif", strlen("gif")) == 0)
data/gpaint-0.3.3/src/canvas.c:934:50:  [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 (g_ascii_strncasecmp (b_name, "gif", strlen("gif")) == 0)
data/gpaint-0.3.3/src/file.c:311:70:  [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).
    gtk_editable_insert_text(GTK_EDITABLE(dialog->width_entry), tmp, strlen(tmp), &position);
data/gpaint-0.3.3/src/file.c:314:71:  [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).
    gtk_editable_insert_text(GTK_EDITABLE(dialog->height_entry), tmp, strlen(tmp), &position);
data/gpaint-0.3.3/src/menu.c:307: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(tmp) > 0) {
data/gpaint-0.3.3/src/menu.c:320:53:  [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).
            gtk_editable_insert_text(editable, tmp, strlen(tmp), &position);
data/gpaint-0.3.3/src/tool_palette.c:495: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).
        int length = strlen(s_key);

ANALYSIS SUMMARY:

Hits = 33
Lines analyzed = 13433 in approximately 0.41 seconds (32843 lines/second)
Physical Source Lines of Code (SLOC) = 9472
Hits@level = [0]   7 [1]  13 [2]  17 [3]   3 [4]   0 [5]   0
Hits@level+ = [0+]  40 [1+]  33 [2+]  20 [3+]   3 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 4.22297 [1+] 3.48395 [2+] 2.11149 [3+] 0.316723 [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.