The following issues were found
drivers/platform/chrome/cros_ec_ishtp.c
1 issues
Line: 298
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
* Copy the buffer received in firmware response for the
* calling thread.
*/
memcpy(client_data->response.data,
rb_in_proc->buffer.data, data_len);
error_wake_up:
/* Free the buffer since we copied data or didn't need it */
ishtp_cl_io_rb_recycle(rb_in_proc);
Reported by FlawFinder.
drivers/net/wireless/microchip/wilc1000/spi.c
1 issues
Line: 491
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
r_data = (struct wilc_spi_read_rsp_data *)&r->data[i];
if (b)
memcpy(b, r_data->data, 4);
if (!clockless && spi_priv->crc16_enabled) {
crc_recv = (r_data->crc[0] << 8) | r_data->crc[1];
crc_calc = crc_itu_t(0xffff, r_data->data, 4);
if (crc_recv != crc_calc) {
Reported by FlawFinder.
drivers/platform/chrome/cros_ec_i2c.c
1 issues
Line: 158
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
for (i = 0; i < sizeof(struct ec_host_response); i++)
sum += ((u8 *)ec_response)[i];
memcpy(msg->data,
in_buf + response_header_size,
ec_response->data_len);
for (i = 0; i < ec_response->data_len; i++)
sum += msg->data[i];
Reported by FlawFinder.
drivers/pinctrl/vt8500/pinctrl-wmt.c
1 issues
Line: 53
Column: 14
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
WMT_FSEL_COUNT = 3,
};
static const char * const wmt_functions[WMT_FSEL_COUNT] = {
[WMT_FSEL_GPIO_IN] = "gpio_in",
[WMT_FSEL_GPIO_OUT] = "gpio_out",
[WMT_FSEL_ALT] = "alt",
};
Reported by FlawFinder.
drivers/pinctrl/sunxi/pinctrl-sunxi.c
1 issues
Line: 770
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
PINS_PER_BANK;
struct sunxi_pinctrl_regulator *s_reg = &pctl->regulators[bank_offset];
struct regulator *reg = s_reg->regulator;
char supply[16];
int ret;
if (reg) {
refcount_inc(&s_reg->refcount);
return 0;
Reported by FlawFinder.
drivers/pinctrl/samsung/pinctrl-samsung.c
1 issues
Line: 896
Column: 4
CWE codes:
120
Suggestion:
Use sprintf_s, snprintf, or vsnprintf
for (bank = 0; bank < drvdata->nr_banks; bank++) {
pin_bank = &drvdata->pin_banks[bank];
for (pin = 0; pin < pin_bank->nr_pins; pin++) {
sprintf(pin_names, "%s-%d", pin_bank->name, pin);
pdesc = pindesc + pin_bank->pin_base + pin;
pdesc->name = pin_names;
pin_names += PIN_NAME_LENGTH;
}
}
Reported by FlawFinder.
drivers/scsi/imm.c
1 issues
Line: 1009
Column: 9
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
/* This routine looks for a device and then attempts to use EPP
to send a command. If all goes as planned then EPP is available. */
static char cmd[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
int loop, old_mode, status, k, ppb = dev->base;
unsigned char l;
old_mode = dev->mode;
for (loop = 0; loop < 8; loop++) {
Reported by FlawFinder.
drivers/pinctrl/renesas/pfc-r8a779a0.c
1 issues
Line: 134
#define GPSR0_0 FM(QSPI0_SPCLK)
/* GPSR1 */
#define GPSR1_30 F_(GP1_30, IP3SR1_27_24)
#define GPSR1_29 F_(GP1_29, IP3SR1_23_20)
#define GPSR1_28 F_(GP1_28, IP3SR1_19_16)
#define GPSR1_27 F_(IRQ3, IP3SR1_15_12)
#define GPSR1_26 F_(IRQ2, IP3SR1_11_8)
#define GPSR1_25 F_(IRQ1, IP3SR1_7_4)
Reported by Cppcheck.
drivers/pinctrl/renesas/pfc-r8a77995.c
1 issues
Line: 45
#define GPSR0_0 FM(USB0_PWEN)
/* GPSR1 */
#define GPSR1_31 F_(QPOLB, IP4_27_24)
#define GPSR1_30 F_(QPOLA, IP4_23_20)
#define GPSR1_29 F_(DU_CDE, IP4_19_16)
#define GPSR1_28 F_(DU_DISP_CDE, IP4_15_12)
#define GPSR1_27 F_(DU_DISP, IP4_11_8)
#define GPSR1_26 F_(DU_VSYNC, IP4_7_4)
Reported by Cppcheck.
drivers/s390/net/qeth_l3.h
1 issues
Line: 98
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 qeth_ipato_entry {
struct list_head entry;
enum qeth_prot_versions proto;
char addr[16];
unsigned int mask_bits;
};
extern const struct attribute_group *qeth_l3_attr_groups[];
Reported by FlawFinder.