packet-amqp.c: Temporary/preliminary fix for Bug #10582 (crash)

This is a temporary/preliminary fix to prevent the buildbot fuzz-test
 failures seen when testing the capture file attached to Bug #10582.

As noted in the bug, a complete fix will require some reworking of
  the amqp dissector.

Change-Id: I2571f1eeb46a7eede04b8d809e87b95f1ff529df
Reviewed-on: https://code.wireshark.org/review/4835
Reviewed-by: Bill Meier <wmeier@newsguy.com>
This commit is contained in:
Bill Meier 2014-10-19 10:04:39 -04:00
parent 8842e2e893
commit 8def8ef9c4
1 changed files with 10 additions and 0 deletions

View File

@ -54,10 +54,20 @@ static guint amqp_port = 5672;
/* Generic defines */
#if 0
#define AMQP_INCREMENT(offset, addend, bound) {\
offset += (addend);\
THROW_ON((offset > bound), ReportedBoundsError); \
}
#else /* --> (temporary until in-progress code review completed; See Bug #10582) */
#define AMQP_INCREMENT(offset, addend, bound) {\
THROW_ON( \
(((unsigned)(offset) + (unsigned)(addend)) < (unsigned)(offset)) || \
(((unsigned)(offset) + (unsigned)(addend)) > (unsigned)(bound )) \
, ReportedBoundsError); \
offset += (addend); \
}
#endif
/*
* This dissector handles AMQP 0-9, 0-10 and 1.0. The conversation structure