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/telegram-purple-1.4.3/msglog.c
Examining data/telegram-purple-1.4.3/msglog.h
Examining data/telegram-purple-1.4.3/telegram-adium/TelegramAccount.h
Examining data/telegram-purple-1.4.3/telegram-adium/TelegramAccountViewController.h
Examining data/telegram-purple-1.4.3/telegram-adium/TelegramAutocompletionDelegate.h
Examining data/telegram-purple-1.4.3/telegram-adium/TelegramJoinChatViewController.h
Examining data/telegram-purple-1.4.3/telegram-adium/TelegramPlugin.h
Examining data/telegram-purple-1.4.3/telegram-adium/TelegramService.h
Examining data/telegram-purple-1.4.3/telegram-base.h
Examining data/telegram-purple-1.4.3/telegram-purple.c
Examining data/telegram-purple-1.4.3/telegram-purple.h
Examining data/telegram-purple-1.4.3/test/loadtest.c
Examining data/telegram-purple-1.4.3/test/probetest.c
Examining data/telegram-purple-1.4.3/tgl/auto-static-autocomplete.c
Examining data/telegram-purple-1.4.3/tgl/auto-static-fetch.c
Examining data/telegram-purple-1.4.3/tgl/auto-static-print-ds.c
Examining data/telegram-purple-1.4.3/tgl/auto-static-store.c
Examining data/telegram-purple-1.4.3/tgl/auto-static.c
Examining data/telegram-purple-1.4.3/tgl/auto.h
Examining data/telegram-purple-1.4.3/tgl/binlog.c
Examining data/telegram-purple-1.4.3/tgl/crypto/aes.h
Examining data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c
Examining data/telegram-purple-1.4.3/tgl/crypto/aes_openssl.c
Examining data/telegram-purple-1.4.3/tgl/crypto/bn.h
Examining data/telegram-purple-1.4.3/tgl/crypto/bn_altern.c
Examining data/telegram-purple-1.4.3/tgl/crypto/bn_openssl.c
Examining data/telegram-purple-1.4.3/tgl/crypto/err.h
Examining data/telegram-purple-1.4.3/tgl/crypto/err_altern.c
Examining data/telegram-purple-1.4.3/tgl/crypto/err_openssl.c
Examining data/telegram-purple-1.4.3/tgl/crypto/md5.h
Examining data/telegram-purple-1.4.3/tgl/crypto/md5_altern.c
Examining data/telegram-purple-1.4.3/tgl/crypto/md5_openssl.c
Examining data/telegram-purple-1.4.3/tgl/crypto/meta.h
Examining data/telegram-purple-1.4.3/tgl/crypto/rand.h
Examining data/telegram-purple-1.4.3/tgl/crypto/rand_altern.c
Examining data/telegram-purple-1.4.3/tgl/crypto/rand_openssl.c
Examining data/telegram-purple-1.4.3/tgl/crypto/rsa_pem.h
Examining data/telegram-purple-1.4.3/tgl/crypto/rsa_pem_altern.c
Examining data/telegram-purple-1.4.3/tgl/crypto/rsa_pem_openssl.c
Examining data/telegram-purple-1.4.3/tgl/crypto/sha.h
Examining data/telegram-purple-1.4.3/tgl/crypto/sha_altern.c
Examining data/telegram-purple-1.4.3/tgl/crypto/sha_openssl.c
Examining data/telegram-purple-1.4.3/tgl/event-old.h
Examining data/telegram-purple-1.4.3/tgl/generate.c
Examining data/telegram-purple-1.4.3/tgl/generate.h
Examining data/telegram-purple-1.4.3/tgl/mime-types.c
Examining data/telegram-purple-1.4.3/tgl/mtproto-client.h
Examining data/telegram-purple-1.4.3/tgl/mtproto-common.h
Examining data/telegram-purple-1.4.3/tgl/mtproto-key.c
Examining data/telegram-purple-1.4.3/tgl/mtproto-key.h
Examining data/telegram-purple-1.4.3/tgl/mtproto-utils.c
Examining data/telegram-purple-1.4.3/tgl/mtproto-utils.h
Examining data/telegram-purple-1.4.3/tgl/no-preview.h
Examining data/telegram-purple-1.4.3/tgl/queries-encrypted.c
Examining data/telegram-purple-1.4.3/tgl/queries.c
Examining data/telegram-purple-1.4.3/tgl/queries.h
Examining data/telegram-purple-1.4.3/tgl/structures.c
Examining data/telegram-purple-1.4.3/tgl/tg-mime-types.c
Examining data/telegram-purple-1.4.3/tgl/tg-mime-types.h
Examining data/telegram-purple-1.4.3/tgl/tgl-binlog.h
Examining data/telegram-purple-1.4.3/tgl/tgl-fetch.h
Examining data/telegram-purple-1.4.3/tgl/tgl-inner.h
Examining data/telegram-purple-1.4.3/tgl/tgl-layout.h
Examining data/telegram-purple-1.4.3/tgl/tgl-methods-in.h
Examining data/telegram-purple-1.4.3/tgl/tgl-net-inner.h
Examining data/telegram-purple-1.4.3/tgl/tgl-net.c
Examining data/telegram-purple-1.4.3/tgl/tgl-net.h
Examining data/telegram-purple-1.4.3/tgl/tgl-queries.h
Examining data/telegram-purple-1.4.3/tgl/tgl-structures.h
Examining data/telegram-purple-1.4.3/tgl/tgl-timers.c
Examining data/telegram-purple-1.4.3/tgl/tgl-timers.h
Examining data/telegram-purple-1.4.3/tgl/tgl.c
Examining data/telegram-purple-1.4.3/tgl/tgl.h
Examining data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser-tree.h
Examining data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c
Examining data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.h
Examining data/telegram-purple-1.4.3/tgl/tl-parser/tl-tl.h
Examining data/telegram-purple-1.4.3/tgl/tl-parser/tlc.c
Examining data/telegram-purple-1.4.3/tgl/tl-parser/portable_endian.h
Examining data/telegram-purple-1.4.3/tgl/tools.h
Examining data/telegram-purple-1.4.3/tgl/tree.h
Examining data/telegram-purple-1.4.3/tgl/updates.c
Examining data/telegram-purple-1.4.3/tgl/updates.h
Examining data/telegram-purple-1.4.3/tgl/mtproto-client.c
Examining data/telegram-purple-1.4.3/tgl/mtproto-common.c
Examining data/telegram-purple-1.4.3/tgl/tools.c
Examining data/telegram-purple-1.4.3/tgp-2prpl.c
Examining data/telegram-purple-1.4.3/tgp-2prpl.h
Examining data/telegram-purple-1.4.3/tgp-blist.c
Examining data/telegram-purple-1.4.3/tgp-blist.h
Examining data/telegram-purple-1.4.3/tgp-chat.c
Examining data/telegram-purple-1.4.3/tgp-chat.h
Examining data/telegram-purple-1.4.3/tgp-ft.c
Examining data/telegram-purple-1.4.3/tgp-ft.h
Examining data/telegram-purple-1.4.3/tgp-info.c
Examining data/telegram-purple-1.4.3/tgp-info.h
Examining data/telegram-purple-1.4.3/tgp-msg.c
Examining data/telegram-purple-1.4.3/tgp-msg.h
Examining data/telegram-purple-1.4.3/tgp-net.c
Examining data/telegram-purple-1.4.3/tgp-net.h
Examining data/telegram-purple-1.4.3/tgp-request.c
Examining data/telegram-purple-1.4.3/tgp-request.h
Examining data/telegram-purple-1.4.3/tgp-structs.c
Examining data/telegram-purple-1.4.3/tgp-structs.h
Examining data/telegram-purple-1.4.3/tgp-timers.c
Examining data/telegram-purple-1.4.3/tgp-timers.h
Examining data/telegram-purple-1.4.3/tgp-utils.c
Examining data/telegram-purple-1.4.3/tgp-utils.h
Examining data/telegram-purple-1.4.3/commit.h
Examining data/telegram-purple-1.4.3/telegram-base.c

FINAL RESULTS:

data/telegram-purple-1.4.3/tgp-msg.c:710:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
            chmod(filename, 0444);
data/telegram-purple-1.4.3/msglog.c:30:3:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  vsnprintf (buffer, sizeof(buffer), format, ap);
data/telegram-purple-1.4.3/test/probetest.c:37:18:  [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.
#define BLURB(x) printf (#x " = %s\n", info->x);
data/telegram-purple-1.4.3/tgl/auto-static-fetch.c:17:20:  [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.
    out_buf_pos += snprintf (out_buf + out_buf_pos, OUT_BUF_SIZE - out_buf_pos, __VA_ARGS__);\
data/telegram-purple-1.4.3/tgl/auto-static-print-ds.c:18:20:  [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.
    out_buf_pos += snprintf (out_buf + out_buf_pos, OUT_BUF_SIZE - out_buf_pos, __VA_ARGS__);\
data/telegram-purple-1.4.3/tgl/generate.c:2946:66:  [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 logprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
data/telegram-purple-1.4.3/tgl/queries.c:539:115:  [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 tgl_set_query_error (struct tgl_state *TLS, int error_code, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
data/telegram-purple-1.4.3/tgl/queries.c:545:3:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  vsnprintf (s, 1000, format, ap);
data/telegram-purple-1.4.3/tgl/queries.c:4886:5:  [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).
    strcpy (s + l, pwd[0]);
data/telegram-purple-1.4.3/tgl/tg-mime-types.c:93:3:  [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).
  strcpy (s, p);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:324:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf (buf, "Expected %s", s);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:925:23:  [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 TL_ERROR(...) fprintf (stderr, __VA_ARGS__);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:926:25:  [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 TL_WARNING(...) fprintf (stderr, __VA_ARGS__);
data/telegram-purple-1.4.3/tgl/tl-parser/tlc.c:66:66:  [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 logprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
data/telegram-purple-1.4.3/tgl/tl-parser/tlc.c:70:3:  [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.
  vfprintf (stderr, format, ap);
data/telegram-purple-1.4.3/tgl/tools.c:95:66:  [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 logprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2), weak));
data/telegram-purple-1.4.3/tgl/tools.c:99:3:  [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.
  vfprintf (stdout, format, ap);
data/telegram-purple-1.4.3/tgl/tools.c:110:11:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  int r = vsnprintf (buf, len, format, ap);
data/telegram-purple-1.4.3/telegram-base.c:388:30:  [3] (buffer) g_get_tmp_dir:
  This function is synonymous with 'getenv("TMP")';it returns untrustable
  input if the environment can beset by an attacker. It 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 (g_str_has_prefix (dir, g_get_tmp_dir())) {
data/telegram-purple-1.4.3/telegram-base.c:392:24:  [3] (buffer) g_get_home_dir:
  This function is synonymous with 'getenv("HOME")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
    dir = g_strconcat (g_get_home_dir(), G_DIR_SEPARATOR_S, ".telegram-purple",
data/telegram-purple-1.4.3/test/loadtest.c:173:19:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  gchar* envvar = getenv ("CONTINUOUS_INTEGRATION");
data/telegram-purple-1.4.3/tgl/generate.c:3010:15:  [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 ((i = getopt (argc, argv, "vhHg:")) != -1) {
data/telegram-purple-1.4.3/tgl/mtproto-common.c:93:21:  [3] (random) lrand48:
  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.
    *(long *)buf ^= lrand48 ();
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:530:101:  [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.
void tgl_do_send_accept_encr_chat (struct tgl_state *TLS, struct tgl_secret_chat *E, unsigned char *random, void (*callback)(struct tgl_state *TLS,void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra) {
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:550:5:  [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.
    random[i] ^= random_here[i];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:552:32:  [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.
  TGLC_bn *b = TGLC_bn_bin2bn (random, 256, 0);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:644:83:  [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.
void tgl_do_send_create_encr_chat (struct tgl_state *TLS, void *x, unsigned char *random, void (*callback)(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_secret_chat *E), void *callback_extra) {
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:650:5:  [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.
    random[i] ^= random_here[i];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:652:32:  [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.
  TGLC_bn *a = TGLC_bn_bin2bn (random, 256, 0);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:683:59:  [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.
  bl_do_encr_chat (TLS, t, NULL, NULL, &our_id, &user_id, random, NULL, NULL, &state, NULL, NULL, NULL, NULL, NULL, NULL, TGLPF_CREATE | TGLPF_CREATED, NULL, 0);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:758:11:  [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.
  memcpy (random, DS_MDC->random->data, 256);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:762:85:  [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.
    ((void (*)(struct tgl_state *, void *, void *, void *, void *))(*x))(TLS, x[1], random, q->callback, q->callback_extra);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:764: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.
    tfree_secure (random, 256);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:766: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.
    tfree_secure (random, 256);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:933:38:  [3] (random) lrand48:
  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.
  *T = tree_insert_var_value (*T, t, lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:941:38:  [3] (random) lrand48:
  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.
  *T = tree_insert_var_value (*T, t, lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:978:80:  [3] (random) lrand48:
  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.
  fields[namespace_level] = tree_insert_tl_field (fields[namespace_level], id, lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:996:73:  [3] (random) lrand48:
  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.
  vars[namespace_level] = tree_insert_tl_var (vars[namespace_level], v, lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1087:56:  [3] (random) lrand48:
  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.
  tl_type_tree = tree_insert_tl_type (tl_type_tree, t, lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1179:79:  [3] (random) lrand48:
  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.
    tl_constructor_tree = tree_insert_tl_constructor (tl_constructor_tree, t, lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1235:71:  [3] (random) lrand48:
  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.
  tl_function_tree = tree_insert_tl_constructor (tl_function_tree, t, lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1906:29:  [3] (random) lrand48:
  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.
        sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1906:56:  [3] (random) lrand48:
  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.
        sprintf (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tlc.c:115:15:  [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 ((i = getopt (argc, argv, "Ehve:w:")) != -1) {
data/telegram-purple-1.4.3/tgp-msg.c:381:36:  [3] (buffer) g_get_tmp_dir:
  This function is synonymous with 'getenv("TMP")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
    gchar *tmp = g_build_filename (g_get_tmp_dir(), purple_imgstore_get_filename (psi), NULL) ;
data/telegram-purple-1.4.3/msglog.c:29: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 buffer[256];
data/telegram-purple-1.4.3/telegram-base.c:42:23:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int state_file_fd = open (name, O_CREAT | O_RDWR | O_BINARY, 0600);
data/telegram-purple-1.4.3/telegram-base.c:79:23:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int state_file_fd = open (name, O_CREAT | O_RDWR | O_BINARY, 0600);
data/telegram-purple-1.4.3/telegram-base.c:146:22:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int auth_file_fd = open (name, O_CREAT | O_RDWR | O_BINARY, 0600);
data/telegram-purple-1.4.3/telegram-base.c:170: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 ip[100];
data/telegram-purple-1.4.3/telegram-base.c:175:19:  [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 auth_key[256];
data/telegram-purple-1.4.3/telegram-base.c:223:22:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int auth_file_fd = open (name, O_CREAT | O_RDWR | O_BINARY, 0600);
data/telegram-purple-1.4.3/telegram-base.c:295:24:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int secret_chat_fd = open (name, O_CREAT | O_RDWR | O_BINARY, 0600);
data/telegram-purple-1.4.3/telegram-base.c:319:10:  [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 s[1000];
data/telegram-purple-1.4.3/telegram-base.c:320:19:  [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 key[256];
data/telegram-purple-1.4.3/telegram-base.c:321:19:  [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 sha[20];
data/telegram-purple-1.4.3/telegram-base.c:363:24:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int secret_chat_fd = open (name, O_RDWR | O_BINARY, 0600);
data/telegram-purple-1.4.3/tgl/auto-static-fetch.c:12: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 out_buf[OUT_BUF_SIZE];
data/telegram-purple-1.4.3/tgl/auto-static-print-ds.c:13: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 out_buf[OUT_BUF_SIZE];
data/telegram-purple-1.4.3/tgl/auto-static-store.c:95: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 exp_buffer[1 << 25];;
data/telegram-purple-1.4.3/tgl/auto-static-store.c:219: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 (R->type, P->type, sizeof (*P->type)); 
data/telegram-purple-1.4.3/tgl/auto-static.c:120: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 (R->type, P->type, sizeof (*P->type)); 
data/telegram-purple-1.4.3/tgl/auto-static.c:166: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 exp_buffer[1 << 25];;
data/telegram-purple-1.4.3/tgl/auto.h:50: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 (r, d, len);
data/telegram-purple-1.4.3/tgl/binlog.c:109: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 (TLS->DC_list[num]->auth_key, buf, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:111:19:  [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 sha1_buffer[20];
data/telegram-purple-1.4.3/tgl/binlog.c:139: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 (TLS->encr_prime, prime, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:520:19:  [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 sha_buffer[20];
data/telegram-purple-1.4.3/tgl/binlog.c:523: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 (P->encr_chat.exchange_key, key, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:526: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 (P->encr_chat.exchange_key, key, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:532: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 (P->encr_chat.exchange_key, P->encr_chat.key, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:535: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 (P->encr_chat.key, key, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:543:7:  [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 (P->encr_chat.key, P->encr_chat.exchange_key, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:550:7:  [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 (P->encr_chat.key, P->encr_chat.exchange_key, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:856:16:  [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[100];
data/telegram-purple-1.4.3/tgl/binlog.c:868: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 (U->g_key, g_key, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:872: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 (U->key, key, 256);
data/telegram-purple-1.4.3/tgl/binlog.c:876: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 (U->first_key_sha, first_key_id, 20);
data/telegram-purple-1.4.3/tgl/crypto/aes.h:29: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 _dummy[
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:42: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.
typedef char check_struct_sizes[(sizeof (TGLC_aes_key) == AES_KEY_BYTES) - 1];
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:46: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 (key->_dummy, userKey, AES_KEY_BYTES);
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:70: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 buf[2 * 16];
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:73: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 (prev_x, ivec + 16, 16);
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:78: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 tmp[16];
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:81: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 (cur_x, in, 16);
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:100: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 (ivec + 16, prev_x, 16);
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:101: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 (ivec, prev_y, 16);
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:109: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 buf[2 * 16];
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:112: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 (prev_y, ivec, 16);
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:117: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 tmp[16];
data/telegram-purple-1.4.3/tgl/crypto/aes_altern.c:120: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 (cur_y, in, 16);
data/telegram-purple-1.4.3/tgl/crypto/aes_openssl.c:30: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.
typedef char check_struct_sizes[(sizeof (AES_KEY) == sizeof (TGLC_aes_key)) - 1];
data/telegram-purple-1.4.3/tgl/crypto/bn_altern.c:111: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 tmp[sizeof (unsigned long)];
data/telegram-purple-1.4.3/tgl/generate.c:59:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  return memcpy (new, s, len);
data/telegram-purple-1.4.3/tgl/generate.c:110: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 buf[1 << 20];
data/telegram-purple-1.4.3/tgl/generate.c:342:7:  [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 (cur_name + L, "->params[%d]", i);
data/telegram-purple-1.4.3/tgl/generate.c:354: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 (cur_name + L, "->params[0]");
data/telegram-purple-1.4.3/tgl/generate.c:358: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 (cur_name + L, "->params[1]");
data/telegram-purple-1.4.3/tgl/generate.c:1141:10:  [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 s[20];
data/telegram-purple-1.4.3/tgl/generate.c:1142:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
  sprintf (s, "field%d", num);
data/telegram-purple-1.4.3/tgl/generate.c:1169:10:  [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 s[20];
data/telegram-purple-1.4.3/tgl/generate.c:1170:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
  sprintf (s, "field%d", num);
data/telegram-purple-1.4.3/tgl/generate.c:1186:10:  [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 s[10000];
data/telegram-purple-1.4.3/tgl/generate.c:1235:10:  [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 s[10000];
data/telegram-purple-1.4.3/tgl/generate.c:1295:10:  [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 s[10000];
data/telegram-purple-1.4.3/tgl/generate.c:1362:10:  [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 s[10000];
data/telegram-purple-1.4.3/tgl/generate.c:1426:10:  [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 s[10000];
data/telegram-purple-1.4.3/tgl/generate.c:1494:10:  [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 s[10000];
data/telegram-purple-1.4.3/tgl/generate.c:1547:10:  [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 s[10000];
data/telegram-purple-1.4.3/tgl/generate.c:1597:10:  [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 s[10000];
data/telegram-purple-1.4.3/tgl/generate.c:2216:10:  [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 s[1000];
data/telegram-purple-1.4.3/tgl/generate.c:2284:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char *gen_what[1000];
data/telegram-purple-1.4.3/tgl/generate.c:3032: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).
  int fd = open (argv[optind], O_RDONLY | O_BINARY);
data/telegram-purple-1.4.3/tgl/mtproto-client.c:94:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE *f = fopen (public_key_name, "r");
data/telegram-purple-1.4.3/tgl/mtproto-client.c:131:52:  [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 int encrypt_packet_buffer_aes_unauth (const char server_nonce[16], const char hidden_client_nonce[32]) {
data/telegram-purple-1.4.3/tgl/mtproto-client.c:131:81:  [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 int encrypt_packet_buffer_aes_unauth (const char server_nonce[16], const char hidden_client_nonce[32]) {
data/telegram-purple-1.4.3/tgl/mtproto-client.c:310:19:  [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 s_power[256];
data/telegram-purple-1.4.3/tgl/mtproto-client.c:508:10:  [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 sha1_buffer[20];
data/telegram-purple-1.4.3/tgl/mtproto-client.c:584:19:  [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 th[44], sha1_buffer[20];
data/telegram-purple-1.4.3/tgl/mtproto-client.c:585: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 (th, DC->new_nonce, 32);
data/telegram-purple-1.4.3/tgl/mtproto-client.c:592: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 (th + 33, sha1_buffer, 8);
data/telegram-purple-1.4.3/tgl/mtproto-client.c:621:7:  [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 (DC->temp_auth_key, DC->auth_key, 256);
data/telegram-purple-1.4.3/tgl/mtproto-client.c:719: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 sha1_buffer[20];
data/telegram-purple-1.4.3/tgl/mtproto-client.c:727: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 (enc->msg_key, sha1_buffer + 4, 16);
data/telegram-purple-1.4.3/tgl/mtproto-client.c:745: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 (enc_msg.message, msg, msg_ints * 4);
data/telegram-purple-1.4.3/tgl/mtproto-client.c:770: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 (enc_msg.message, msg, msg_ints * 4);
data/telegram-purple-1.4.3/tgl/mtproto-client.c:778: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 (data, &enc_msg, l + UNENCSZ);
data/telegram-purple-1.4.3/tgl/mtproto-client.c:1085:19:  [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 sha1_buffer[20];
data/telegram-purple-1.4.3/tgl/mtproto-client.c:1154:10:  [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 Response[MAX_RESPONSE_SIZE];
data/telegram-purple-1.4.3/tgl/mtproto-client.c:1223: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 (DC->temp_auth_key, DC->auth_key, 256);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:69: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).
  int r = 0, h = open ("/dev/random", O_RDONLY | O_NONBLOCK);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:81: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).
    h = open ("/dev/urandom", O_RDONLY);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:148: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 rb[32];
data/telegram-purple-1.4.3/tgl/mtproto-common.c:155:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    int fd = open (password_filename, O_RDONLY | O_BINARY);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:206:10:  [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 tempbuff[4096];
data/telegram-purple-1.4.3/tgl/mtproto-common.c:207:19:  [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 sha[20]; 
data/telegram-purple-1.4.3/tgl/mtproto-common.c:227: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 (dest, str, len);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:263: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 (packet_ptr, data, len);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:340: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.
static unsigned char aes_key_raw[32], aes_iv[32];
data/telegram-purple-1.4.3/tgl/mtproto-common.c:343:33:  [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.
void tgl_init_aes_unauth (const char server_nonce[16], const char hidden_client_nonce[32], int encrypt) {
data/telegram-purple-1.4.3/tgl/mtproto-common.c:343:62:  [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.
void tgl_init_aes_unauth (const char server_nonce[16], const char hidden_client_nonce[32], int encrypt) {
data/telegram-purple-1.4.3/tgl/mtproto-common.c:344:19:  [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 buffer[64], hash[20];
data/telegram-purple-1.4.3/tgl/mtproto-common.c:345: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 (buffer, hidden_client_nonce, 32);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:346: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 (buffer + 32, server_nonce, 16);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:348: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 (buffer + 32, hidden_client_nonce, 32);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:350: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 (buffer, server_nonce, 16);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:351: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 (buffer + 16, hidden_client_nonce, 32);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:353: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 (aes_key_raw + 20, hash, 12);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:354: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 (aes_iv, hash + 12, 8);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:355: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 (aes_iv + 28, hidden_client_nonce, 4);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:364:25:  [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.
void tgl_init_aes_auth (char auth_key[192], char msg_key[16], int encrypt) {
data/telegram-purple-1.4.3/tgl/mtproto-common.c:364:45:  [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.
void tgl_init_aes_auth (char auth_key[192], char msg_key[16], int encrypt) {
data/telegram-purple-1.4.3/tgl/mtproto-common.c:365:19:  [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 buffer[48], hash[20];
data/telegram-purple-1.4.3/tgl/mtproto-common.c:372: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 (buffer, msg_key, 16);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:373: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 (buffer + 16, auth_key, 32);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:375: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 (aes_key_raw, hash, 8);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:376: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 (aes_iv, hash + 8, 12);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:378: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 (buffer, auth_key + 32, 16);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:379: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 (buffer + 16, msg_key, 16);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:380: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 (buffer + 32, auth_key + 48, 16);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:382: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 (aes_key_raw + 8, hash + 8, 12);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:383: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 (aes_iv + 12, hash, 8);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:385: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 (buffer, auth_key + 64, 32);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:386: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 (buffer + 32, msg_key, 16);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:388: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 (aes_key_raw + 20, hash + 4, 12);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:389: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 (aes_iv + 20, hash + 16, 4);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:391: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 (buffer, msg_key, 16);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:392: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 (buffer + 16, auth_key + 96, 32);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:394: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 (aes_iv + 24, hash, 8);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:110: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 msg_key[16];
data/telegram-purple-1.4.3/tgl/mtproto-common.h:138: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 (packet_ptr, what, len * 4);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:230: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 (r, s, i);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:245: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 (*s, r, l);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:318: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 (data, in_ptr, size);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:323: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 (data, in_ptr, size);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:344: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 (data, in_ptr, 4 * count);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:353: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 + 256 - l, s, l);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:356: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, s + (l - 256), 256);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:374:33:  [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.
void tgl_init_aes_unauth (const char server_nonce[16], const char hidden_client_nonce[32], int encrypt);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:374:62:  [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.
void tgl_init_aes_unauth (const char server_nonce[16], const char hidden_client_nonce[32], int encrypt);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:375:25:  [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.
void tgl_init_aes_auth (char auth_key[192], char msg_key[16], int encrypt);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:375:45:  [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.
void tgl_init_aes_auth (char auth_key[192], char msg_key[16], int encrypt);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:9:19:  [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 sha1a_buffer[20];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:10:19:  [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 sha1b_buffer[20];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:11:19:  [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 sha1c_buffer[20];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:12:19:  [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 sha1d_buffer[20];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:16: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 (msg_key, sha1a_buffer + 4, 16);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:18:19:  [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 buf[64];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:19: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 (buf, msg_key, 16);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:20: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 (buf + 16, E->key, 32);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:23: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 (buf, E->key + 8, 16);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:24: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 (buf + 16, msg_key, 16);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:25: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 (buf + 32, E->key + 12, 16);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:28: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 (buf, E->key + 16, 32);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:29: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 (buf + 32, msg_key, 16);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:32: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 (buf, msg_key, 16);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:33: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 (buf + 16, E->key + 24, 32);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:36:19:  [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 key[32];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:37: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 (key, sha1a_buffer + 0, 8);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:38: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 (key + 8, sha1b_buffer + 8, 12);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:39: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 (key + 20, sha1c_buffer + 4, 12);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:41:19:  [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 iv[32];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:42: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 (iv, sha1a_buffer + 8, 12);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:43: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 (iv + 12, sha1b_buffer + 0, 8);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:44: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 (iv + 20, sha1c_buffer + 16, 4);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:45: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 (iv + 24, sha1d_buffer + 0, 8);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:79: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 (encr_extra, encrypt_decrypted_message (E), 16);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:424: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 md5[16];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:425: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 str[64];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:426: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 (str, f->key, 32);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:427: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 (str + 32, f->init_iv, 32);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:547: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 random_here[256];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:565:19:  [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 kk[256];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:568:19:  [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 sha_buffer[20];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:595:19:  [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 buf[256];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:623: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 (t, U->key, 256);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:628:19:  [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 sha_buffer[20];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:636: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 (U->first_key_sha, sha_buffer, 20);
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:647: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 random_here[256];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:669:10:  [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 g_a[256];
data/telegram-purple-1.4.3/tgl/queries-encrypted.c:758: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 (random, DS_MDC->random->data, 256);
data/telegram-purple-1.4.3/tgl/queries.c:232: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 (q->data, data, 4 * ints);
data/telegram-purple-1.4.3/tgl/queries.c:499:10:  [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[32];
data/telegram-purple-1.4.3/tgl/queries.c:515: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[4096];
data/telegram-purple-1.4.3/tgl/queries.c:524: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[4096];
data/telegram-purple-1.4.3/tgl/queries.c:532: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[4096];
data/telegram-purple-1.4.3/tgl/queries.c:541:10:  [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 s[1001];
data/telegram-purple-1.4.3/tgl/queries.c:730:9:  [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 (r + 1, text + p + 9, len);
data/telegram-purple-1.4.3/tgl/queries.c:812: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 (n, new_text, cur_p);
data/telegram-purple-1.4.3/tgl/queries.c:1279: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).
  int fd = open (file_name, O_RDONLY | O_BINARY);
data/telegram-purple-1.4.3/tgl/queries.c:1287:10:  [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[(1 << 20) + 1];
data/telegram-purple-1.4.3/tgl/queries.c:2078: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[512 << 10];
data/telegram-purple-1.4.3/tgl/queries.c:2123: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).
  int fd = open (file_name, O_RDONLY | O_BINARY);
data/telegram-purple-1.4.3/tgl/queries.c:2202: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 (f->init_iv, f->iv, 32);
data/telegram-purple-1.4.3/tgl/queries.c:3191:13:  [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).
    D->fd = open (D->name, O_CREAT | O_WRONLY | O_BINARY, 0640);
data/telegram-purple-1.4.3/tgl/queries.c:3320: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[PATH_MAX];
data/telegram-purple-1.4.3/tgl/queries.c:3512: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 (D->iv, V->iv, 32);
data/telegram-purple-1.4.3/tgl/queries.c:3521: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 md5[16];
data/telegram-purple-1.4.3/tgl/queries.c:3522: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 str[64];
data/telegram-purple-1.4.3/tgl/queries.c:3523: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 (str, V->key, 32);
data/telegram-purple-1.4.3/tgl/queries.c:3524: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 (str + 32, V->iv, 32);
data/telegram-purple-1.4.3/tgl/queries.c:4071:77:  [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.
int tgl_do_visualize_key (struct tgl_state *TLS, tgl_peer_id_t id, unsigned char buf[16]) {
data/telegram-purple-1.4.3/tgl/queries.c:4079: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 (buf, P->encr_chat.first_key_sha, 16);
data/telegram-purple-1.4.3/tgl/queries.c:4678:10:  [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 s[512];
data/telegram-purple-1.4.3/tgl/queries.c:4679:19:  [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 shab[32];
data/telegram-purple-1.4.3/tgl/queries.c:4689: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 (s, current_salt, current_salt_len);
data/telegram-purple-1.4.3/tgl/queries.c:4690: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 (s + current_salt_len, current_password, current_password_len);
data/telegram-purple-1.4.3/tgl/queries.c:4691: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 (s + current_salt_len + current_password_len, current_salt, current_salt_len);
data/telegram-purple-1.4.3/tgl/queries.c:4703: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 d[256];
data/telegram-purple-1.4.3/tgl/queries.c:4704: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 (d, new_salt, new_salt_len);
data/telegram-purple-1.4.3/tgl/queries.c:4709: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 (s, d, l);
data/telegram-purple-1.4.3/tgl/queries.c:4711: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 (s + l, new_password, new_password_len);
data/telegram-purple-1.4.3/tgl/queries.c:4712: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 (s + l + new_password_len, d, l);
data/telegram-purple-1.4.3/tgl/queries.c:4809: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 s[512];
data/telegram-purple-1.4.3/tgl/queries.c:4873:10:  [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 s[512];
data/telegram-purple-1.4.3/tgl/queries.c:4874:19:  [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 shab[32];
data/telegram-purple-1.4.3/tgl/queries.c:4883: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 (s, E->current_salt, l);
data/telegram-purple-1.4.3/tgl/queries.c:4888: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 (s + l + r, E->current_salt, l);
data/telegram-purple-1.4.3/tgl/queries.c:4918:10:  [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 s[512];
data/telegram-purple-1.4.3/tgl/structures.c:95: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.
  const char *d[4];
data/telegram-purple-1.4.3/tgl/structures.c:97:10:  [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[10000];
data/telegram-purple-1.4.3/tgl/structures.c:399: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, src + src_len - 256, 256);
data/telegram-purple-1.4.3/tgl/structures.c:402: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 + 256 - src_len, src, src_len);
data/telegram-purple-1.4.3/tgl/structures.c:408: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, src + src_len - 32, 32);
data/telegram-purple-1.4.3/tgl/structures.c:411: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 + 32 - src_len, src, src_len);
data/telegram-purple-1.4.3/tgl/structures.c:446:19:  [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 g_key[256];
data/telegram-purple-1.4.3/tgl/structures.c:1634:19:  [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 sha1a_buffer[20];
data/telegram-purple-1.4.3/tgl/structures.c:1635:19:  [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 sha1b_buffer[20];
data/telegram-purple-1.4.3/tgl/structures.c:1636:19:  [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 sha1c_buffer[20];
data/telegram-purple-1.4.3/tgl/structures.c:1637:19:  [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 sha1d_buffer[20];
data/telegram-purple-1.4.3/tgl/structures.c:1639:19:  [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 buf[64];
data/telegram-purple-1.4.3/tgl/structures.c:1643: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 (buf, msg_key, 16);
data/telegram-purple-1.4.3/tgl/structures.c:1644: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 (buf + 16, e_key, 32);
data/telegram-purple-1.4.3/tgl/structures.c:1647: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 (buf, e_key + 8, 16);
data/telegram-purple-1.4.3/tgl/structures.c:1648: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 (buf + 16, msg_key, 16);
data/telegram-purple-1.4.3/tgl/structures.c:1649: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 (buf + 32, e_key + 12, 16);
data/telegram-purple-1.4.3/tgl/structures.c:1652: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 (buf, e_key + 16, 32);
data/telegram-purple-1.4.3/tgl/structures.c:1653: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 (buf + 32, msg_key, 16);
data/telegram-purple-1.4.3/tgl/structures.c:1656: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 (buf, msg_key, 16);
data/telegram-purple-1.4.3/tgl/structures.c:1657: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 (buf + 16, e_key + 24, 32);
data/telegram-purple-1.4.3/tgl/structures.c:1660:19:  [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 key[32];
data/telegram-purple-1.4.3/tgl/structures.c:1661: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 (key, sha1a_buffer + 0, 8);
data/telegram-purple-1.4.3/tgl/structures.c:1662: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 (key + 8, sha1b_buffer + 8, 12);
data/telegram-purple-1.4.3/tgl/structures.c:1663: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 (key + 20, sha1c_buffer + 4, 12);
data/telegram-purple-1.4.3/tgl/structures.c:1665:19:  [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 iv[32];
data/telegram-purple-1.4.3/tgl/structures.c:1666: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 (iv, sha1a_buffer + 8, 12);
data/telegram-purple-1.4.3/tgl/structures.c:1667: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 (iv + 12, sha1b_buffer + 0, 8);
data/telegram-purple-1.4.3/tgl/structures.c:1668: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 (iv + 20, sha1c_buffer + 16, 4);
data/telegram-purple-1.4.3/tgl/structures.c:1669: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 (iv + 24, sha1d_buffer + 0, 8);
data/telegram-purple-1.4.3/tgl/tg-mime-types.c:9: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 *mime_type_names[MAX_MIME_TYPES_NUM];
data/telegram-purple-1.4.3/tgl/tg-mime-types.c:10: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 *mime_type_extensions[MAX_MIME_TYPES_NUM];
data/telegram-purple-1.4.3/tgl/tg-mime-types.c:92:10:  [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 s[11];
data/telegram-purple-1.4.3/tgl/tgl-layout.h:170: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 auth_key[256];
data/telegram-purple-1.4.3/tgl/tgl-layout.h:171: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 temp_auth_key[256];
data/telegram-purple-1.4.3/tgl/tgl-layout.h:172: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 nonce[256];
data/telegram-purple-1.4.3/tgl/tgl-layout.h:173: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 new_nonce[256];
data/telegram-purple-1.4.3/tgl/tgl-layout.h:174: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 server_nonce[256];
data/telegram-purple-1.4.3/tgl/tgl-layout.h:470: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 first_key_sha[20];
data/telegram-purple-1.4.3/tgl/tgl-net.c:144:7:  [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 (c->out_tail->wptr, data, len);
data/telegram-purple-1.4.3/tgl/tgl-net.c:151:7:  [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 (c->out_tail->wptr, data, y);
data/telegram-purple-1.4.3/tgl/tgl-net.c:176:7:  [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 (data, c->in_head->rptr, len);
data/telegram-purple-1.4.3/tgl/tgl-net.c:181:7:  [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 (data, c->in_head->rptr, y);
data/telegram-purple-1.4.3/tgl/tgl-net.c:209:7:  [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 (data, b->rptr, len);
data/telegram-purple-1.4.3/tgl/tgl-net.c:212:7:  [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 (data, b->rptr, y);
data/telegram-purple-1.4.3/tgl/tgl-queries.h:169:84:  [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.
int tgl_do_visualize_key (struct tgl_state *TLS, tgl_secret_chat_id_t id, unsigned char buf[16]);
data/telegram-purple-1.4.3/tgl/tgl.h:207: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 *rsa_key_list[TGL_MAX_RSA_KEYS_NUM];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:66: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.
typedef char error_int_must_be_4_byte[(sizeof (int) == 4) ? 1 : -1];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:67: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.
typedef char error_long_long_must_be_8_byte[(sizeof (long long) == 8) ? 1 : -1];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:86: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 (t, P->c, sizeof (void *) * (P->size - 1));
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:323: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[1000];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:334: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).
  int fd = open (fname, O_RDONLY);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:891: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 (z, a, len);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1055: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 (id, _id, len);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1137: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 (id, _id, x);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1200: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 (id, _id, x);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1240: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 buf[(1 << 20)];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1253: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 (S, T, sizeof (*S));
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1291: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 (buf + buf_pos, s, len); buf_pos += len;
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1298: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 (buf + buf_pos, s, len); buf_pos += len;
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1354:16:  [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[30];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1355:9:  [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 (_buf, "+%lld", T->type_flags);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1381: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.
      static char _buf[30];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1391: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.
      static char _buf[30];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1392:7:  [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 (_buf, "%lld", T->left->type_flags);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1423:10:  [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[10];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1424:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
  sprintf (_buf, "#%08x", c->name);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1904: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.
      static char s[21];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1906:9:  [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 (s, "%lld", lrand48 () * (1ll << 32) + lrand48 ());
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:2260:10:  [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[100000];
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:2348:10:  [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[100000];
data/telegram-purple-1.4.3/tgl/tl-parser/tlc.c:59:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int f = open (filename, O_CREAT | O_WRONLY | O_TRUNC, 0640);
data/telegram-purple-1.4.3/tgl/tools.c:123: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 (rs, *res, strlen (*res) + 1);
data/telegram-purple-1.4.3/tgl/tools.c:169: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 (p, ptr, size >= old_size ? old_size : size); 
data/telegram-purple-1.4.3/tgl/tools.c:215: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 (p, s, l + 1);
data/telegram-purple-1.4.3/tgl/tools.c:223: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 (p, s, l);
data/telegram-purple-1.4.3/tgl/tools.c:230: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 (r, s, n);
data/telegram-purple-1.4.3/tgp-2prpl.c:194: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(tga, tga_header, sizeof(tga_header));
data/telegram-purple-1.4.3/tgp-2prpl.c:196: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(tga + sizeof(tga_header), raw_bgra, width * height * 4);
data/telegram-purple-1.4.3/tgp-blist.c:176:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    if (id && *id && atoi (id) == GPOINTER_TO_INT(extra)) {
data/telegram-purple-1.4.3/tgp-chat.c:45:12:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    type = atoi (T);
data/telegram-purple-1.4.3/tgp-chat.c:47:45:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  return tgl_set_peer_id (type, (I && *I) ? atoi (I) : 0);
data/telegram-purple-1.4.3/tgp-chat.c:348:16:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  if (value && atoi (value)) {
data/telegram-purple-1.4.3/tgp-chat.c:349:64:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    tgl_peer_t *P = tgl_peer_get (gc_get_tls (gc), TGL_MK_CHAT(atoi (value)));
data/telegram-purple-1.4.3/tgp-chat.c:351:57:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      P = tgl_peer_get (gc_get_tls (gc), TGL_MK_CHANNEL(atoi (value)));
data/telegram-purple-1.4.3/tgp-chat.c:364:58:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      warning ("Cannot join chat %d, peer not found...", atoi (value));
data/telegram-purple-1.4.3/tgp-msg.c:39: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 (out, start, end - start);
data/telegram-purple-1.4.3/tgp-msg.c:317:19:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        int img = atoi (id + 4);
data/telegram-purple-1.4.3/tgp-msg.c:359:13:  [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 (! open) {
data/telegram-purple-1.4.3/tgp-msg.c:361:9:  [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(html + j, "<code>", 6);
data/telegram-purple-1.4.3/tgp-msg.c:365:9:  [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(html + j, "</code>", 7);
data/telegram-purple-1.4.3/tgp-msg.c:368:16:  [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).
      open = ! open;
data/telegram-purple-1.4.3/tgp-net.c:129:7:  [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 (c->out_tail->wptr, data, len);
data/telegram-purple-1.4.3/tgp-net.c:136:7:  [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 (c->out_tail->wptr, data, y);
data/telegram-purple-1.4.3/tgp-net.c:161:7:  [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 (data, c->in_head->rptr, len);
data/telegram-purple-1.4.3/tgp-net.c:166:7:  [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 (data, c->in_head->rptr, y);
data/telegram-purple-1.4.3/tgp-net.c:194:7:  [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 (data, b->rptr, len);
data/telegram-purple-1.4.3/tgp-net.c:197:7:  [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 (data, b->rptr, y);
data/telegram-purple-1.4.3/tgp-request.c:159: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.
  const char *users[3] = {
data/telegram-purple-1.4.3/tgp-request.c:203: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.
  const char *names[3] = {
data/telegram-purple-1.4.3/tgp-request.c:238: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.
  const char *names[2] = {
data/telegram-purple-1.4.3/msglog.c:32:19:  [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 last = (int)strlen (buffer) - 1;
data/telegram-purple-1.4.3/telegram-base.c:49:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (state_file_fd, &magic, 4) < 4) { close (state_file_fd); return; }
data/telegram-purple-1.4.3/telegram-base.c:51:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (state_file_fd, &version, 4) < 4 || version < 0) { close (state_file_fd); return; }
data/telegram-purple-1.4.3/telegram-base.c:53:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (state_file_fd, x, 16) < 16) {
data/telegram-purple-1.4.3/telegram-base.c:135:11:  [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 l = strlen (DC->options[ex->flags]->ip);
data/telegram-purple-1.4.3/telegram-base.c:166:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (auth_file_fd, &port, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:168:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (auth_file_fd, &l, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:171:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (auth_file_fd, ip, l) == l);
data/telegram-purple-1.4.3/telegram-base.c:176:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (auth_file_fd, &auth_key_id, 8) == 8);
data/telegram-purple-1.4.3/telegram-base.c:177:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (auth_file_fd, auth_key, 256) == 256);
data/telegram-purple-1.4.3/telegram-base.c:198:58:  [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).
    bl_do_dc_option (TLS, 0, 1, "", 0, TG_SERVER_TEST_1, strlen (TG_SERVER_TEST_1), 443);
data/telegram-purple-1.4.3/telegram-base.c:199:58:  [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).
    bl_do_dc_option (TLS, 0, 2, "", 0, TG_SERVER_TEST_2, strlen (TG_SERVER_TEST_2), 443);
data/telegram-purple-1.4.3/telegram-base.c:200:58:  [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).
    bl_do_dc_option (TLS, 0, 3, "", 0, TG_SERVER_TEST_3, strlen (TG_SERVER_TEST_3), 443);
data/telegram-purple-1.4.3/telegram-base.c:204:60:  [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).
      bl_do_dc_option (TLS, 1, 1, "", 0, TG_SERVER_IPV6_1, strlen (TG_SERVER_IPV6_1), 443);
data/telegram-purple-1.4.3/telegram-base.c:205:60:  [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).
      bl_do_dc_option (TLS, 1, 2, "", 0, TG_SERVER_IPV6_2, strlen (TG_SERVER_IPV6_2), 443);
data/telegram-purple-1.4.3/telegram-base.c:206:60:  [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).
      bl_do_dc_option (TLS, 1, 3, "", 0, TG_SERVER_IPV6_3, strlen (TG_SERVER_IPV6_3), 443);
data/telegram-purple-1.4.3/telegram-base.c:207:60:  [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).
      bl_do_dc_option (TLS, 1, 4, "", 0, TG_SERVER_IPV6_4, strlen (TG_SERVER_IPV6_4), 443);
data/telegram-purple-1.4.3/telegram-base.c:208:60:  [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).
      bl_do_dc_option (TLS, 1, 5, "", 0, TG_SERVER_IPV6_5, strlen (TG_SERVER_IPV6_5), 443);
data/telegram-purple-1.4.3/telegram-base.c:210:55:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      bl_do_dc_option (TLS, 0, 1, "", 0, TG_SERVER_1, strlen (TG_SERVER_1), 443);
data/telegram-purple-1.4.3/telegram-base.c:211:55:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      bl_do_dc_option (TLS, 0, 2, "", 0, TG_SERVER_2, strlen (TG_SERVER_2), 443);
data/telegram-purple-1.4.3/telegram-base.c:212:55:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      bl_do_dc_option (TLS, 0, 3, "", 0, TG_SERVER_3, strlen (TG_SERVER_3), 443);
data/telegram-purple-1.4.3/telegram-base.c:213:55:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      bl_do_dc_option (TLS, 0, 4, "", 0, TG_SERVER_4, strlen (TG_SERVER_4), 443);
data/telegram-purple-1.4.3/telegram-base.c:214:55:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      bl_do_dc_option (TLS, 0, 5, "", 0, TG_SERVER_5, strlen (TG_SERVER_5), 443);
data/telegram-purple-1.4.3/telegram-base.c:232:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (auth_file_fd, &m, 4) < 4 || (m != DC_SERIALIZED_MAGIC)) {
data/telegram-purple-1.4.3/telegram-base.c:237:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (auth_file_fd, &x, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:240:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (auth_file_fd, &dc_working_num, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:245:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    assert (read (auth_file_fd, &y, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:252:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  int l = read (auth_file_fd, &our_id, 4);
data/telegram-purple-1.4.3/telegram-base.c:273:11:  [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 l = strlen (P->print_name);
data/telegram-purple-1.4.3/telegram-base.c:322:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &id, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:323:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &l, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:325:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, s, l) == l);
data/telegram-purple-1.4.3/telegram-base.c:326:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &user_id, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:327:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &admin_id, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:328:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &date, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:329:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &ttl, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:330:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &layer, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:331:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &access_hash, 8) == 8);
data/telegram-purple-1.4.3/telegram-base.c:332:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &state, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:333:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &key_fingerprint, 8) == 8);
data/telegram-purple-1.4.3/telegram-base.c:334:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (fd, &key, 256) == 256);
data/telegram-purple-1.4.3/telegram-base.c:336:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    assert (read (fd, sha, 20) == 20);
data/telegram-purple-1.4.3/telegram-base.c:346:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    assert (read (fd, &in_seq_no, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:347:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    assert (read (fd, &last_in_seq_no, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:348:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    assert (read (fd, &out_seq_no, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:369:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (secret_chat_fd, &x, 4) < 4) { close (secret_chat_fd); return; }
data/telegram-purple-1.4.3/telegram-base.c:372:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (secret_chat_fd, &v, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:374:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  assert (read (secret_chat_fd, &x, 4) == 4);
data/telegram-purple-1.4.3/telegram-base.c:443:57:  [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).
    tgl_do_create_group_chat (TLS, j, ids, title, (int) strlen(title),
data/telegram-purple-1.4.3/telegram-purple.c:445: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).
  tgl_do_import_chat_link (TLS, link, (int) strlen(link), import_chat_link_done, NULL);
data/telegram-purple-1.4.3/tgl/auto-static-autocomplete.c:58: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).
  int len = strlen (text);
data/telegram-purple-1.4.3/tgl/auto-static.c:312: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).
  int len = strlen (text);
data/telegram-purple-1.4.3/tgl/binlog.c:57:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if ((int)strlen (a) != l) { return 1; }
data/telegram-purple-1.4.3/tgl/generate.c:331:11:  [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 L = strlen (cur_name);
data/telegram-purple-1.4.3/tgl/generate.c:542:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (arg->id && strlen (arg->id) && !empty) {
data/telegram-purple-1.4.3/tgl/generate.c:622:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (arg->id && strlen (arg->id) > 0 && !empty) {
data/telegram-purple-1.4.3/tgl/generate.c:623:150:  [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).
    printf ("%sif (cur_token_len >= 0 && cur_token_len == %d && !cur_token_quoted && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
data/telegram-purple-1.4.3/tgl/generate.c:703:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (arg->id && strlen (arg->id) > 0 && !empty) {
data/telegram-purple-1.4.3/tgl/generate.c:704:161:  [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).
    printf ("%sif (cur_token_len == -3 && cur_token_real_len <= %d && !cur_token_quoted && !memcmp (cur_token, \"%s\", cur_token_real_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
data/telegram-purple-1.4.3/tgl/generate.c:709:129:  [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).
    printf ("%sif (cur_token_len >= 0 && cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
data/telegram-purple-1.4.3/tgl/generate.c:794: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:821: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:842: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:851: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:884: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:909: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:925: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:932: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:962: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:992: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:1008: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:1035:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (arg->id && strlen (arg->id) && !empty) {
data/telegram-purple-1.4.3/tgl/generate.c:1045: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:1074: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:1094: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).
      if (arg->id && strlen (arg->id)) {
data/telegram-purple-1.4.3/tgl/generate.c:1125:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (arg->id && strlen (arg->id) > 0) {
data/telegram-purple-1.4.3/tgl/generate.c:1126:161:  [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).
    printf ("%sif (cur_token_len == -3 && cur_token_real_len <= %d && !cur_token_quoted && !memcmp (cur_token, \"%s\", cur_token_real_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
data/telegram-purple-1.4.3/tgl/generate.c:1131:129:  [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).
    printf ("%sif (cur_token_len >= 0 && cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
data/telegram-purple-1.4.3/tgl/generate.c:1159:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (arg->id && strlen (arg->id) > 0) {
data/telegram-purple-1.4.3/tgl/generate.c:1160:150:  [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).
    printf ("%sif (cur_token_len >= 0 && cur_token_len == %d && !cur_token_quoted && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", offset, (int)(strlen (arg->id)), arg->id);
data/telegram-purple-1.4.3/tgl/generate.c:1187:3:  [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 (s, "T");
data/telegram-purple-1.4.3/tgl/generate.c:1236:3:  [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 (s, "T");
data/telegram-purple-1.4.3/tgl/generate.c:1296:3:  [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 (s, "T");
data/telegram-purple-1.4.3/tgl/generate.c:1363:3:  [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 (s, "T");
data/telegram-purple-1.4.3/tgl/generate.c:1427:3:  [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 (s, "T");
data/telegram-purple-1.4.3/tgl/generate.c:1495:3:  [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 (s, "T");
data/telegram-purple-1.4.3/tgl/generate.c:1548:3:  [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 (s, "T");
data/telegram-purple-1.4.3/tgl/generate.c:1598:3:  [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 (s, "T");
data/telegram-purple-1.4.3/tgl/generate.c:1737:102:  [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).
        printf ("  if (cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", (int)strlen (t->constructors[i]->id), t->constructors[i]->id);
data/telegram-purple-1.4.3/tgl/generate.c:1778:102:  [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).
        printf ("  if (cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", (int)strlen (t->constructors[i]->id), t->constructors[i]->id);
data/telegram-purple-1.4.3/tgl/generate.c:2442:98:  [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).
    printf ("  if (cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", (int)strlen (fns[i]->id), fns[i]->id);
data/telegram-purple-1.4.3/tgl/generate.c:2519:98:  [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).
    printf ("  if (cur_token_len == %d && !memcmp (cur_token, \"%s\", cur_token_len)) {\n", (int)strlen (fns[i]->id), fns[i]->id);
data/telegram-purple-1.4.3/tgl/generate.c:2557:31:  [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 (c->args[k]->id && strlen (c->args[k]->id) && j > 0) {
data/telegram-purple-1.4.3/tgl/generate.c:2575:33:  [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 (!c->args[k]->id || !strlen (c->args[k]->id)) {          
data/telegram-purple-1.4.3/tgl/generate.c:2989:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		int rval = read (fd, buf + rs, len - rs);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:71:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    r = read (h, buf, n);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:85:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int s = read (h, buf + r, n - r);
data/telegram-purple-1.4.3/tgl/mtproto-common.c:160:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int l = read (fd, a, password_length);
data/telegram-purple-1.4.3/tgl/mtproto-common.h:174: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).
  out_cstring (str, strlen (str));
data/telegram-purple-1.4.3/tgl/queries.c:122:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if ((int)strlen (a) != l) { return 1; }
data/telegram-purple-1.4.3/tgl/queries.c:1217:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      text_len = strlen (new_text);
data/telegram-purple-1.4.3/tgl/queries.c:1288:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  int x = read (fd, buf, (1 << 20) + 1);
data/telegram-purple-1.4.3/tgl/queries.c:1928:28:  [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 *s = f->file_name + strlen (f->file_name);
data/telegram-purple-1.4.3/tgl/queries.c:1972:28:  [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 *s = f->file_name + strlen (f->file_name);
data/telegram-purple-1.4.3/tgl/queries.c:2079:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int x = read (f->fd, buf, f->part_size);
data/telegram-purple-1.4.3/tgl/queries.c:4745:7:  [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 (pwd) != (size_t)E->new_password_len || memcmp (E->new_password, pwd, E->new_password_len)) {
data/telegram-purple-1.4.3/tgl/queries.c:4770: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).
  E->new_password_len = strlen (pwd[0]);
data/telegram-purple-1.4.3/tgl/queries.c:4777: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).
  E->current_password_len = strlen (pwd[0]);
data/telegram-purple-1.4.3/tgl/queries.c:4799:19:  [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).
    E->hint_len = strlen (new_hint);
data/telegram-purple-1.4.3/tgl/queries.c:4877:11:  [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).
  assert (strlen (pwd[0]) <= 128);
data/telegram-purple-1.4.3/tgl/queries.c:4885: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).
    int r = strlen (pwd[0]);
data/telegram-purple-1.4.3/tgl/queries.c:5306:88:  [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).
  tgl_do_send_code_result (TLS, E->phone, E->phone_len, E->hash, E->hash_len, code[0], strlen (code[0]), tgl_sign_in_result, E);
data/telegram-purple-1.4.3/tgl/queries.c:5334:93:  [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).
  tgl_do_send_code_result_auth (TLS, E->phone, E->phone_len, E->hash, E->hash_len, code[0], strlen (code[0]), E->first_name, E->first_name_len, E->last_name, E->last_name_len, tgl_sign_up_result, E);
data/telegram-purple-1.4.3/tgl/queries.c:5339: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).
  E->last_name_len = strlen (last_name);
data/telegram-purple-1.4.3/tgl/queries.c:5344:7:  [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 (first_name) < 1) {
data/telegram-purple-1.4.3/tgl/queries.c:5348: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).
  E->first_name_len = strlen (first_name);
data/telegram-purple-1.4.3/tgl/queries.c:5356:7:  [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 (yn) > 1) {
data/telegram-purple-1.4.3/tgl/queries.c:5358: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).
  } else if (strlen (yn) == 0 || *yn == 'y' || *yn == 'Y') {
data/telegram-purple-1.4.3/tgl/queries.c:5389:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  E->hash_len = strlen (mhash);
data/telegram-purple-1.4.3/tgl/queries.c:5401:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  E->phone_len = strlen (phone[0]);
data/telegram-purple-1.4.3/tgl/queries.c:5419: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).
  tgl_do_send_bot_auth (TLS, code[0], strlen (code[0]), tgl_sign_in_bot_cb, NULL);
data/telegram-purple-1.4.3/tgl/queries.c:5548: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).
  out_cstring (code[0], strlen (code[0]));
data/telegram-purple-1.4.3/tgl/queries.c:5565:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  E->hash_len = strlen (mhash);
data/telegram-purple-1.4.3/tgl/structures.c:102:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (d[i] && strlen (d[i])) {
data/telegram-purple-1.4.3/tgl/structures.c:116:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int fl = strlen (s);
data/telegram-purple-1.4.3/tgl/tg-mime-types.c:77:11:  [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 l = strlen (filename);
data/telegram-purple-1.4.3/tgl/tg-mime-types.c:89:7:  [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 (p) > 10) {
data/telegram-purple-1.4.3/tgl/tgl-net.c:506:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int r = read (c->fd, c->in_tail->wptr, c->in_tail->end - c->in_tail->wptr);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:181: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).
      tfree (last_error, strlen (last_error) + 1);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:322:139:  [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 (!parse.lex.ptr || parse.lex.ptr == (void *)-1 || parse.lex.type == lex_error || parse.lex.type == lex_none || parse.lex.len != (int)strlen (s) || memcmp (s, parse.lex.ptr, parse.lex.len)) {
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:348:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  save.len = read (fd, save.text, size);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1289: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).
  if (len < 0) { len = strlen (s); }
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1296: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).
  if (len < 0) { len = strlen (s); }
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:1942:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    struct tl_var *v = tl_get_var (id, strlen (id));
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:2262:43:  [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).
  struct tl_type *nt = tl_add_type (_buf, strlen (_buf), t->params_num - cc, t->params_types >> cc);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:2288:62:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    struct tl_constructor *r = tl_add_constructor (nt, _buf, strlen (_buf), 1);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:2352:72:  [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).
  struct tl_constructor *r = !fun ? tl_add_constructor (c->type, _buf, strlen (_buf), 1) : tl_add_function (c->type, _buf, strlen (_buf), 1);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:2352:124:  [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).
  struct tl_constructor *r = !fun ? tl_add_constructor (c->type, _buf, strlen (_buf), 1) : tl_add_function (c->type, _buf, strlen (_buf), 1);
data/telegram-purple-1.4.3/tgl/tl-parser/tl-parser.c:2740: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).
    int x = strlen (s);
data/telegram-purple-1.4.3/tgl/tools.c:122: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).
  void *rs = talloc (strlen (*res) + 1);
data/telegram-purple-1.4.3/tgl/tools.c:123: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).
  memcpy (rs, *res, strlen (*res) + 1);
data/telegram-purple-1.4.3/tgl/tools.c:213:11:  [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 l = strlen (s);
data/telegram-purple-1.4.3/tgl/tools.h:111: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).
  tfree (ptr, strlen ((const char *)ptr) + 1);
data/telegram-purple-1.4.3/tgp-chat.c:373:58:  [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).
    tgl_do_import_chat_link (gc_get_tls (gc), link, (int)strlen (link), tgp_notify_on_error_gw, NULL);
data/telegram-purple-1.4.3/tgp-msg.c:259:54:  [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).
    tgl_do_send_message (D->TLS, D->to, D->msg, (int)strlen (D->msg), flags, NULL, tgp_msg_send_done, D->msg);
data/telegram-purple-1.4.3/tgp-msg.c:307:19:  [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 len = (int) strlen (msg);
data/telegram-purple-1.4.3/tgp-msg.c:338:19:  [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 len = (int) strlen (msg);
data/telegram-purple-1.4.3/tgp-msg.c:530:60:  [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).
        quote = purple_markup_escape_text (reply->message, strlen (reply->message));
data/telegram-purple-1.4.3/tgp-msg.c:662:57:  [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).
          text = purple_markup_escape_text (M->message, strlen (M->message));
data/telegram-purple-1.4.3/tgp-msg.c:705:44:  [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).
              const char *segment = path + strlen(path) - 1;
data/telegram-purple-1.4.3/tgp-msg.c:784:48:  [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).
        text = purple_markup_escape_text (msg, strlen (msg));
data/telegram-purple-1.4.3/tgp-utils.c:111:19:  [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 len = (int) strlen (mime);
data/telegram-purple-1.4.3/tgp-utils.c:125: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).
  int slen = strlen (str), wlen = strlen (with);
data/telegram-purple-1.4.3/tgp-utils.c:125:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int slen = strlen (str), wlen = strlen (with);

ANALYSIS SUMMARY:

Hits = 514
Lines analyzed = 38229 in approximately 1.41 seconds (27102 lines/second)
Physical Source Lines of Code (SLOC) = 30758
Hits@level = [0] 929 [1] 154 [2] 315 [3]  27 [4]  17 [5]   1
Hits@level+ = [0+] 1443 [1+] 514 [2+] 360 [3+]  45 [4+]  18 [5+]   1
Hits/KSLOC@level+ = [0+] 46.9146 [1+] 16.7111 [2+] 11.7043 [3+] 1.46303 [4+] 0.585214 [5+] 0.0325119
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.