The following issues were found
fs/ubifs/master.c
1 issues
Line: 107
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
list);
if (snod->type != UBIFS_MST_NODE)
goto out_dump;
memcpy(c->mst_node, snod->node, snod->len);
offs = snod->offs;
}
ubifs_scan_destroy(sleb);
lnum += 1;
Reported by FlawFinder.
include/linux/nls.h
1 issues
Line: 99
Column: 2
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
nls_nullsize(const struct nls_table *codepage)
{
int charlen;
char tmp[NLS_MAX_CHARSET_SIZE];
charlen = codepage->uni2char(0, tmp, NLS_MAX_CHARSET_SIZE);
return charlen > 0 ? charlen : 1;
}
Reported by FlawFinder.
fs/ubifs/replay.c
1 issues
Line: 464
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
r->sqnum = sqnum;
key_copy(c, key, &r->key);
fname_len(&r->nm) = nlen;
memcpy(nbuf, name, nlen);
nbuf[nlen] = '\0';
fname_name(&r->nm) = nbuf;
list_add_tail(&r->list, &c->replay_list);
return 0;
Reported by FlawFinder.
fs/ubifs/sb.c
1 issues
Line: 732
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
c->default_compr = le16_to_cpu(sup->default_compr);
c->vfs_sb->s_time_gran = le32_to_cpu(sup->time_gran);
memcpy(&c->uuid, &sup->uuid, 16);
c->big_lpt = !!(sup_flags & UBIFS_FLG_BIGLPT);
c->space_fixup = !!(sup_flags & UBIFS_FLG_SPACE_FIXUP);
c->double_hash = !!(sup_flags & UBIFS_FLG_DOUBLE_HASH);
c->encrypted = !!(sup_flags & UBIFS_FLG_ENCRYPTION);
Reported by FlawFinder.
fs/fscache/netfs.c
1 issues
Line: 25
Column: 20
CWE codes:
126
/* allocate a cookie for the primary index */
candidate = fscache_alloc_cookie(&fscache_fsdef_index,
&fscache_fsdef_netfs_def,
netfs->name, strlen(netfs->name),
&netfs->version, sizeof(netfs->version),
netfs, 0);
if (!candidate) {
_leave(" = -ENOMEM");
return -ENOMEM;
Reported by FlawFinder.
drivers/video/fbdev/vt8500lcdfb.c
1 issues
Line: 288
Column: 2
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
if (!fbi)
return -ENOMEM;
strcpy(fbi->fb.fix.id, "VT8500 LCD");
fbi->fb.fix.type = FB_TYPE_PACKED_PIXELS;
fbi->fb.fix.xpanstep = 0;
fbi->fb.fix.ypanstep = 1;
fbi->fb.fix.ywrapstep = 0;
Reported by FlawFinder.
fs/ubifs/tnc_commit.c
1 issues
Line: 784
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
goto out;
}
destroy_old_idx(c);
memcpy(zroot, &c->zroot, sizeof(struct ubifs_zbranch));
err = ubifs_save_dirty_idx_lnums(c);
if (err)
goto out;
Reported by FlawFinder.
fs/fscache/internal.h
1 issues
Line: 368
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
p = cookie->aux;
if (memcmp(p, aux_data, cookie->aux_len) != 0) {
memcpy(p, aux_data, cookie->aux_len);
set_bit(FSCACHE_COOKIE_AUX_UPDATED, &cookie->flags);
}
}
/*****************************************************************************/
Reported by FlawFinder.
fs/freevxfs/vxfs_immed.c
1 issues
Line: 73
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
caddr_t kaddr;
kaddr = kmap(pp);
memcpy(kaddr, vip->vii_immed.vi_immed + offset, PAGE_SIZE);
kunmap(pp);
flush_dcache_page(pp);
SetPageUptodate(pp);
unlock_page(pp);
Reported by FlawFinder.
include/linux/nubus.h
1 issues
Line: 43
Column: 2
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
motherboard and onboard peripherals (Ethernet, video) */
int slot;
/* For slot 0, this is bogus. */
char name[64];
/* Format block */
unsigned char *fblock;
/* Root directory (does *not* always equal fblock + doffset!) */
unsigned char *directory;
Reported by FlawFinder.