The following issues were found

src/third_party/wiredtiger/src/conn/api_calc_modify.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 103 Column: 5 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  uint64_t h;

    WT_STATIC_ASSERT(sizeof(h) <= WT_CM_BLOCKSIZE);
    memcpy(&h, p, WT_CM_BLOCKSIZE);
    return (h);
}

/*
 * __wt_calc_modify --

            

Reported by FlawFinder.

src/third_party/wiredtiger/src/config/config_ext.c
1 issues
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)
Security

Line: 84 Column: 15 CWE codes: 126

                      while (cfg[1] != NULL)
            ++cfg;
        p = *cfg;
        len = strlen(p);
    }

    return (wiredtiger_config_parser_open(wt_session, p, len, config_parserp));
}

            

Reported by FlawFinder.

src/third_party/wiredtiger/src/config/config_check.c
1 issues
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)
Security

Line: 105 Column: 23 CWE codes: 126

                      } else if (strcmp(checks[i].type, "category") == 0) {
            /* Deal with categories of the form: XXX=(XXX=blah). */
            ret = config_check(session, checks[i].subconfigs, checks[i].subconfigs_entries,
              k.str + strlen(checks[i].name) + 1, v.len);
            if (ret != EINVAL)
                badtype = false;
            else
                badtype = true;
        } else if (strcmp(checks[i].type, "format") == 0) {

            

Reported by FlawFinder.

src/third_party/unwind/dist/tests/test-static-link-gen.c
1 issues
printf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 58 Column: 5 CWE codes: 134
Suggestion: Use a constant for the format specification

              test_generic (void)
{
  if (verbose)
    printf (__FILE__": funcs[0]=%p\n", funcs[0]);

#ifndef UNW_REMOTE_ONLY
  {
    unw_context_t uc;
    unw_cursor_t c;

            

Reported by FlawFinder.

src/third_party/wiredtiger/src/btree/row_modify.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 311 Column: 5 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
    ins->u.key.offset = WT_STORE_SIZE(ins_size - key->size);
    WT_INSERT_KEY_SIZE(ins) = WT_STORE_SIZE(key->size);
    memcpy(WT_INSERT_KEY(ins), key->data, key->size);

    *insp = ins;
    if (ins_sizep != NULL)
        *ins_sizep = ins_size;
    return (0);

            

Reported by FlawFinder.

src/third_party/wiredtiger/src/btree/bt_sync.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 194 Column: 5 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

                  uint64_t newest_stop_txn;
    uint32_t i;
    uint8_t previous_state;
    char tp_string[WT_TP_STRING_SIZE];
    const char *tag;
    bool busy, hazard, obsolete;

    /* Ignore root pages as they can never be deleted. */
    if (__wt_ref_is_root(ref)) {

            

Reported by FlawFinder.

src/third_party/wiredtiger/src/btree/bt_slvg.c
1 issues
syntax error
Error

Line: 1872

                   */
    skip_start = skip_stop = 0;
    if (F_ISSET(trk, WT_TRACK_CHECK_START))
        WT_ROW_FOREACH (page, rip, i) {
            WT_ERR(__wt_row_leaf_key(session, page, rip, key, false));

            /*
             * >= is correct: see the comment above.
             */

            

Reported by Cppcheck.

src/third_party/wiredtiger/src/btree/bt_import.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 28 Column: 5 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

                  WT_DECL_RET;
    WT_KEYED_ENCRYPTOR *kencryptor;
    uint32_t allocsize;
    char *checkpoint_list, *config, *config_tmp, *metadata, fileid[64];
    const char *cfg[] = {WT_CONFIG_BASE(session, file_meta), NULL, NULL, NULL, NULL, NULL, NULL};
    const char *filename;

    ckptbase = NULL;
    checkpoint_list = config = config_tmp = metadata = NULL;

            

Reported by FlawFinder.

src/third_party/wiredtiger/src/btree/bt_delete.c
1 issues
syntax error
Error

Line: 369

                  count = 0;
    upd_array = page->modify->mod_row_update;
    if ((insert = WT_ROW_INSERT_SMALLEST(page)) != NULL)
        WT_SKIP_FOREACH (ins, insert) {
            WT_ERR(__tombstone_update_alloc(session, page_del, &upd, &size));
            total_size += size;
            upd->next = ins->upd;
            ins->upd = upd;


            

Reported by Cppcheck.

src/third_party/unwind/dist/tests/Gtest-concurrent.c
1 issues
fprintf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 43 Column: 7 CWE codes: 134
Suggestion: Use a constant for the format specification

              #define NTHREADS	128

#define panic(args...)						\
	do { fprintf (stderr, args); ++nerrors; } while (0)

int verbose;
int nerrors;
int got_usr1, got_usr2;
char *sigusr1_sp;

            

Reported by FlawFinder.