Uninitialized variable in ipa_ccm_make_id_resp_from_req()

We are allocating a buffer on the stack without initializing it, and
then passing it into ipa_ccm_make_id_resp().  There is no real danger
from this, as the buffer is only uninitialized if num_ies is 0, but
let's memset() it for good style

Change-Id: If5761a47b8cba73ddcc02a88cfa5c87c1970c04e
Fixes: coverity CID#167040
This commit is contained in:
Harald Welte 2017-04-27 10:25:10 +02:00
parent 0b2f7153f2
commit 8a4895c0e5
1 changed files with 2 additions and 0 deletions

View File

@ -302,6 +302,8 @@ struct msgb *ipa_ccm_make_id_resp_from_req(const struct ipaccess_unit *dev,
unsigned int num_ies = 0;
const uint8_t *cur = data;
memset(ies, 0, sizeof(ies));
/* build a array of the IEIs */
while (len >= 2) {
uint8_t t_len, t_tag;