Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix potential unsigned integer underflow
  • Loading branch information
phaag committed Jul 27, 2019
1 parent 7c0d06a commit 3b006ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
@@ -1,6 +1,7 @@
2019-07-25
- Rework nfpcapd and add it officially to the nfdump collection.
- Add nfpcapd man page
- Fix potential unsigned integer underflow #171

2019-07-16
- Add latency extension if dumping flowcache
Expand Down
10 changes: 9 additions & 1 deletion bin/ipfix.c
Expand Up @@ -1247,7 +1247,7 @@ int i;
uint32_t table_id, count, size_required;
uint32_t num_extensions = 0;

if ( size_left && size_left < 4 ) {
if ( size_left < 4 ) {
LogError("Process_ipfix [%u] Template size error at %s line %u" ,
exporter->info.id, __FILE__, __LINE__, strerror (errno));
size_left = 0;
Expand Down Expand Up @@ -1426,6 +1426,14 @@ ipfix_template_record_t *ipfix_template_record;
while ( size_left ) {
uint32_t id;

if ( size_left < 4 ) {
LogError("Process_ipfix [%u] Template withdraw size error at %s line %u" ,
exporter->info.id, __FILE__, __LINE__, strerror (errno));
size_left = 0;
continue;
}


// map next record.
ipfix_template_record = (ipfix_template_record_t *)DataPtr;
size_left -= 4;
Expand Down

0 comments on commit 3b006ed

Please sign in to comment.