Module: kamailio
Branch: master
Commit: 1d9a972692a44210884137c5d941909022ce6183
URL:
https://github.com/kamailio/kamailio/commit/1d9a972692a44210884137c5d941909…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-09-15T11:01:45+02:00
misc/fuzz: deeper parsing for From/To
---
Modified: misc/fuzz/fuzz_parse_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/1d9a972692a44210884137c5d941909…
Patch:
https://github.com/kamailio/kamailio/commit/1d9a972692a44210884137c5d941909…
---
diff --git a/misc/fuzz/fuzz_parse_msg.c b/misc/fuzz/fuzz_parse_msg.c
index 8de9175549..1c813fd715 100644
--- a/misc/fuzz/fuzz_parse_msg.c
+++ b/misc/fuzz/fuzz_parse_msg.c
@@ -2,6 +2,8 @@
#include "../parser/parse_uri.c"
#include "../parser/parse_hname2.h"
#include "../parser/contact/parse_contact.h"
+#include "../parser/parse_from.h"
+#include "../parser/parse_to.h"
#include "../parser/parse_refer_to.h"
#include "../parser/parse_ppi_pai.h"
#include "../parser/parse_privacy.h"
@@ -19,22 +21,29 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
sip_msg_t orig_inv = { };
orig_inv.buf = (char*)data;
orig_inv.len = size;
+
if (parse_msg(orig_inv.buf, orig_inv.len, &orig_inv) < 0) {
goto cleanup;
}
-
+
+ parse_headers(&orig_inv, HDR_EOH_F, 0);
+
parse_sdp(&orig_inv);
- parse_headers(&orig_inv, HDR_TO_F, 0);
+ parse_from_header(&orig_inv);
+
+ parse_from_uri(&orig_inv);
+
+ parse_to_header(&orig_inv);
+
+ parse_to_uri(&orig_inv);
parse_contact_header(&orig_inv);
parse_refer_to_header(&orig_inv);
- parse_to_header(&orig_inv);
-
parse_pai_header(&orig_inv);
-
+
parse_diversion_header(&orig_inv);
parse_privacy(&orig_inv);