Fix MSAN getservbyport() false positive

Closes GH-15814
This commit is contained in:
Ilija Tovilo 2024-09-09 17:32:52 +02:00
parent 1f35e2a999
commit 0faa1d2017
No known key found for this signature in database
GPG key ID: 5050C66BFCD1015A

View file

@ -112,6 +112,10 @@ PHPAPI php_basic_globals basic_globals;
#include "streamsfuncs.h"
#include "basic_functions_arginfo.h"
#if __has_feature(memory_sanitizer)
# include <sanitizer/msan_interface.h>
#endif
typedef struct _user_tick_function_entry {
zend_fcall_info fci;
zend_fcall_info_cache fci_cache;
@ -2263,6 +2267,10 @@ PHP_FUNCTION(getservbyport)
RETURN_FALSE;
}
/* MSAN false positive, getservbyport() is not properly intercepted. */
#if __has_feature(memory_sanitizer)
__msan_unpoison_string(serv->s_name);
#endif
RETURN_STRING(serv->s_name);
}
/* }}} */