summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d6aff7a)
Coverity:
CID 739612 (#1 of 1): Buffer not null terminated (BUFFER_SIZE)
At (5): Calling strncpy with a source string whose length (4 chars) is
greater than or equal to the size argument (4) will fail to
null-terminate "hello->head".
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
memcpy(&ROUTER_ID, &olsr_cnf->main_addr, sizeof(union olsr_ip_addr));
hello = (struct RtElHelloPkt *) malloc(sizeof(struct RtElHelloPkt));
OLSR_PRINTF(1,"initialization running step 1\n");
memcpy(&ROUTER_ID, &olsr_cnf->main_addr, sizeof(union olsr_ip_addr));
hello = (struct RtElHelloPkt *) malloc(sizeof(struct RtElHelloPkt));
OLSR_PRINTF(1,"initialization running step 1\n");
- strncpy(hello->head, "$REP", 4);
+ memcpy(hello->head, "$REP", 4);
if(olsr_cnf->ip_version == AF_INET)
hello->ipFamily = AF_INET;
else
if(olsr_cnf->ip_version == AF_INET)
hello->ipFamily = AF_INET;
else