-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Description
freeing a pointer causes memory corruption in ccn-lite-fetch
here in code:
ccn-lite/src/ccnl-utils/src/ccn-lite-fetch.c
Lines 137 to 141 in da0d9de
| *prefix = ccnl_prefix_dup(pkt->pfx); | |
| *lastchunknum = pkt->val.final_block_id; | |
| *content = pkt->content; | |
| *contentlen = pkt->contlen; | |
| ccnl_pkt_free(pkt); |
assigning content and content length pointer values from pkt to external pointers and then freeing the pkt itself also removes the pointers pointing to the memory location and causes memory corruption and garbage output from any write operation:
ccn-lite/src/ccnl-utils/src/ccn-lite-fetch.c
Line 360 in da0d9de
| write(1, content, contlen); |
possible solution would be passing the pkt itself out of function and free it after write function
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels