fixed bug #35291: NULL pointer in pbuf_copy

This commit is contained in:
goldsimon 2012-01-20 21:19:26 +01:00
parent 1d96195f47
commit 83b46811f9
2 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,9 @@ HISTORY
++ New features: ++ New features:
2012-01-20: Simon Goldschmidt
* pbuf.c: fixed bug #35291: NULL pointer in pbuf_copy
2012-01-16: Simon Goldschmidt 2012-01-16: Simon Goldschmidt
* opt.h, icmp.c: Added option CHECKSUM_GEN_ICMP * opt.h, icmp.c: Added option CHECKSUM_GEN_ICMP

View File

@ -863,7 +863,7 @@ pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
/* iterate through pbuf chain */ /* iterate through pbuf chain */
do do
{ {
LWIP_ASSERT("p_to != NULL", p_to != NULL); LWIP_ERROR("p_to != NULL", p_to != NULL, return ERR_ARG;);
/* copy one part of the original chain */ /* copy one part of the original chain */
if ((p_to->len - offset_to) >= (p_from->len - offset_from)) { if ((p_to->len - offset_to) >= (p_from->len - offset_from)) {
/* complete current p_from fits into current p_to */ /* complete current p_from fits into current p_to */