aboutsummaryrefslogtreecommitdiff
path: root/src/fragmentation/defragmentation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-07-27 07:40:39 +0000
committerChristian Grothoff <christian@grothoff.org>2011-07-27 07:40:39 +0000
commit8d6058c34df98102009ca0a9456da0bcb06d39f2 (patch)
treee93287bf9a78df33dc454005418548a3b1bee52b /src/fragmentation/defragmentation.c
parent22dafb003418aab11e036230b3761116c397d239 (diff)
downloadgnunet-8d6058c34df98102009ca0a9456da0bcb06d39f2.tar.gz
gnunet-8d6058c34df98102009ca0a9456da0bcb06d39f2.zip
fix
Diffstat (limited to 'src/fragmentation/defragmentation.c')
-rw-r--r--src/fragmentation/defragmentation.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c
index 29d2c3c42..8aad86003 100644
--- a/src/fragmentation/defragmentation.c
+++ b/src/fragmentation/defragmentation.c
@@ -18,7 +18,7 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20/** 20/**
21 * @file src/fragmentation/defragmentation_new.c 21 * @file src/fragmentation/defragmentation.c
22 * @brief library to help defragment messages 22 * @brief library to help defragment messages
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 */ 24 */
@@ -441,6 +441,11 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
441 } 441 }
442 fh = (const struct FragmentHeader*) msg; 442 fh = (const struct FragmentHeader*) msg;
443 msize = ntohs (fh->total_size); 443 msize = ntohs (fh->total_size);
444 if (msize < sizeof (struct GNUNET_MessageHeader))
445 {
446 GNUNET_break_op (0);
447 return GNUNET_SYSERR;
448 }
444 fid = ntohl (fh->fragment_id); 449 fid = ntohl (fh->fragment_id);
445 foff = ntohs (fh->offset); 450 foff = ntohs (fh->offset);
446 if (foff >= msize) 451 if (foff >= msize)
@@ -554,5 +559,5 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
554 return GNUNET_YES; 559 return GNUNET_YES;
555} 560}
556 561
557/* end of defragmentation_new.c */ 562/* end of defragmentation.c */
558 563