There is a sizeof operand mismatch in ccn-lite-rpc.c
368 nonce->aux = malloc(sizeof(int));
The allocated size is of sizeof(int) but probably should be sizeof(struct rdr_ds_s *). See also the definition of struct rdr_ds_s *aux in ccnl-pkt-localrpc.h
55 struct rdr_ds_s { // RPC Data Representation (RDR) data structure
56 int type;
57 int flatlen;
58 unsigned char *flat;
59 struct rdr_ds_s *nextinseq;
60 union {
61 struct rdr_ds_s *fct;
62 struct rdr_ds_s *lambdavar;
63 unsigned int nonnegintval;
64 int namelen;
65 int binlen;
66 int strlen;
67 } u;
68 struct rdr_ds_s *aux;
69 };
70
Description
There is a sizeof operand mismatch in
ccn-lite-rpc.c
The allocated size is of
sizeof(int)
but probably should besizeof(struct rdr_ds_s *)
. See also the definition ofstruct rdr_ds_s *aux
inccnl-pkt-localrpc.h
EDIT: This bug was identified by
scan-build
.