mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
Fix possible null pointer dereference in identify_data BIF.
There was no check/handling for if magic_buffer() returns null. Also centralized libmagic calls for consistent error handling/output.
This commit is contained in:
parent
dd9f361bc7
commit
2481f9f837
5 changed files with 47 additions and 46 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <magic.h>
|
||||
#include "config.h"
|
||||
|
||||
#if __STDC__
|
||||
|
@ -364,4 +365,7 @@ struct CompareString
|
|||
}
|
||||
};
|
||||
|
||||
void bro_init_magic(magic_t* cookie_ptr, int flags);
|
||||
const char* bro_magic_buffer(magic_t cookie, const void* buffer, size_t length);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue