Skip to content

Fix undefined behaviour in DoH (passing NULL to memmove())

Artem Boldariev requested to merge artem/doh-memmove-null-asan-fix into main

The warning was produced by an ASAN build:

netmgr/http.c:1039:34: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:47:14: note: nonnull attribute specified here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior netmgr/http.c:1039:34 in 

This MR fixes it by checking if nghttp2_session_mem_send() has actually returned anything.

Edited by Artem Boldariev

Merge request reports