The following issues were found
sound/soc/intel/skylake/skl-debug.c
1 issues
Line: 199
Column: 10
CWE codes:
126
ret += scnprintf(tmp + ret, FW_REG_BUF - ret, "%#.4x: ", offset);
hex_dump_to_buffer(d->fw_read_buff + offset, 16, 16, 4,
tmp + ret, FW_REG_BUF - ret, 0);
ret += strlen(tmp + ret);
/* print newline for each offset */
if (FW_REG_BUF - ret > 0)
tmp[ret++] = '\n';
}
Reported by FlawFinder.
security/tomoyo/gc.c
1 issues
Line: 74
Column: 22
CWE codes:
126
static bool tomoyo_name_used_by_io_buffer(const char *string)
{
struct tomoyo_io_buffer *head;
const size_t size = strlen(string) + 1;
bool in_use = false;
spin_lock(&tomoyo_io_buffer_list_lock);
list_for_each_entry(head, &tomoyo_io_buffer_list, list) {
int i;
Reported by FlawFinder.
sound/usb/6fire/firmware.c
1 issues
Line: 383
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
ret = usb6fire_fw_fpga_upload(intf, "6fire/dmx6firecf.bin");
if (ret < 0)
return ret;
memcpy(buffer, ep_w_max_packet_size,
sizeof(ep_w_max_packet_size));
ret = usb6fire_fw_ezusb_upload(intf, "6fire/dmx6fireap.ihx",
0x0003, buffer, sizeof(ep_w_max_packet_size));
if (ret < 0)
return ret;
Reported by FlawFinder.
sound/soc/intel/skylake/skl-pcm.c
1 issues
Line: 1492
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
skl->dais = dais;
memcpy(&skl->dais[ARRAY_SIZE(skl_platform_dai)], skl_fe_dai,
sizeof(skl_fe_dai));
num_dais += ARRAY_SIZE(skl_fe_dai);
}
ret = devm_snd_soc_register_component(dev, &skl_component,
Reported by FlawFinder.
scripts/kconfig/lkc.h
1 issues
Line: 28
Column: 9
CWE codes:
807
20
Suggestion:
Check environment variables carefully before using them
#endif
static inline const char *CONFIG_prefix(void)
{
return getenv( "CONFIG_" ) ?: CONFIG_;
}
#undef CONFIG_
#define CONFIG_ CONFIG_prefix()
extern int yylineno;
Reported by FlawFinder.
scripts/genksyms/keywords.c
1 issues
Line: 73
Column: 11
CWE codes:
126
int i;
for (i = 0; i < NR_KEYWORDS; i++) {
struct resword *r = keywords + i;
int l = strlen(r->name);
if (len == l && !memcmp(str, r->name, len))
return r->token;
}
return -1;
}
Reported by FlawFinder.
sound/soc/intel/skylake/skl-sst-ipc.c
1 issues
Line: 284
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
size_t tx_size)
{
if (tx_size)
memcpy(msg->tx.data, tx_data, tx_size);
}
static bool skl_ipc_is_dsp_busy(struct sst_dsp *dsp)
{
u32 hipci;
Reported by FlawFinder.
sound/soc/intel/skylake/skl-sst-ipc.h
1 issues
Line: 66
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
#define SKL_MAX_LIB 16
struct skl_lib_info {
char name[SKL_LIB_NAME_LENGTH];
const struct firmware *fw;
};
struct skl_ipc_init_instance_msg {
u32 module_id;
Reported by FlawFinder.
sound/soc/intel/skylake/skl-sst.c
1 issues
Line: 414
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
{
struct skl_module_table *module_entry = NULL;
int ret = 0;
char mod_name[64]; /* guid str = 32 chars + 4 hyphens */
snprintf(mod_name, sizeof(mod_name), "intel/dsp_fw_%pUL.bin", guid);
module_entry = skl_module_get_from_id(ctx, mod_id);
if (module_entry == NULL) {
Reported by FlawFinder.
scripts/genksyms/genksyms.h
1 issues
Line: 67
Column: 63
CWE codes:
134
Suggestion:
Use a constant for the format specification
int yylex(void);
int yyparse(void);
void error_with_pos(const char *, ...) __attribute__ ((format(printf, 1, 2)));
/*----------------------------------------------------------------------*/
#define xmalloc(size) ({ void *__ptr = malloc(size); \
if(!__ptr && size != 0) { \
fprintf(stderr, "out of memory\n"); \
Reported by FlawFinder.