]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix stack-use-after-scope in dns_message_checksig test
authorOndřej Surý <ondrej@isc.org>
Tue, 27 Sep 2022 11:00:09 +0000 (13:00 +0200)
committerPetr Špaček <pspacek@isc.org>
Tue, 27 Sep 2022 11:06:01 +0000 (13:06 +0200)
Previously stack with buffer for test dns message went out of scope
before the message was processed. For fuzz testing its better to avoid
allocation, so let's avoid allocations completely and use simplest
possible static buffer.

Fixes: #3565
fuzz/dns_message_checksig.c

index 4f248fc2e6c6f19cb6cb40de5831a594887a8088..bead6be995350c7316b7211fe6f2b98fb4caca97 100644 (file)
@@ -213,7 +213,7 @@ create_message(dns_message_t **messagep, const uint8_t *data, size_t size,
        isc_result_t result;
        dns_message_t *message = NULL;
        isc_buffer_t b;
-       unsigned char buf[65535];
+       static unsigned char buf[65535];
 
        isc_buffer_init(&b, buf, sizeof(buf));