gnu.cfg: Added support for gethostbyname_r() and gethostbyname2_r()
This commit is contained in:
parent
3576f0a0c7
commit
ccbc6a3b72
108
cfg/gnu.cfg
108
cfg/gnu.cfg
|
@ -530,6 +530,114 @@
|
||||||
</arg>
|
</arg>
|
||||||
<leak-ignore/>
|
<leak-ignore/>
|
||||||
</function>
|
</function>
|
||||||
|
<!-- https://man7.org/linux/man-pages/man3/gethostbyaddr_r.3.html -->
|
||||||
|
<!-- int gethostbyaddr_r(const void *addr, socklen_t len, int type, struct hostent *restrict ret, char *restrict buf, size_t buflen, struct hostent **restrict result, int *restrict h_errnop); -->
|
||||||
|
<function name="gethostbyaddr_r">
|
||||||
|
<returnValue type="int"/>
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<use-retval/>
|
||||||
|
<pure/>
|
||||||
|
<arg nr="1" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<not-null/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<valid>0:</valid>
|
||||||
|
</arg>
|
||||||
|
<arg nr="3" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="4" direction="out">
|
||||||
|
<not-null/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="5" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<not-null/>
|
||||||
|
<minsize type="argvalue" arg="6"/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="6" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<valid>0:</valid>
|
||||||
|
</arg>
|
||||||
|
<arg nr="7" direction="in">
|
||||||
|
<not-null/>
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="8" direction="in">
|
||||||
|
<not-null/>
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
|
<!-- https://man7.org/linux/man-pages/man3/gethostbyname2_r.3.html -->
|
||||||
|
<!-- int gethostbyname2_r(const char *name, int af, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); -->
|
||||||
|
<function name="gethostbyname2_r">
|
||||||
|
<returnValue type="int"/>
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<use-retval/>
|
||||||
|
<pure/>
|
||||||
|
<arg nr="1" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<not-null/>
|
||||||
|
<strz/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="3" direction="out">
|
||||||
|
<not-null/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="4" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<not-null/>
|
||||||
|
<minsize type="argvalue" arg="5"/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="5" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<valid>0:</valid>
|
||||||
|
</arg>
|
||||||
|
<arg nr="6" direction="in">
|
||||||
|
<not-null/>
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="7" direction="in">
|
||||||
|
<not-null/>
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
|
<!-- https://man7.org/linux/man-pages/man3/gethostbyname_r.3.html -->
|
||||||
|
<!-- int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); -->
|
||||||
|
<function name="gethostbyname_r">
|
||||||
|
<returnValue type="int"/>
|
||||||
|
<noreturn>false</noreturn>
|
||||||
|
<use-retval/>
|
||||||
|
<pure/>
|
||||||
|
<arg nr="1" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<not-null/>
|
||||||
|
<strz/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="2" direction="out">
|
||||||
|
<not-null/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="3" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<not-null/>
|
||||||
|
<minsize type="argvalue" arg="4"/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="4" direction="in">
|
||||||
|
<not-uninit/>
|
||||||
|
<valid>0:</valid>
|
||||||
|
</arg>
|
||||||
|
<arg nr="5" direction="in">
|
||||||
|
<not-null/>
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
<arg nr="6" direction="in">
|
||||||
|
<not-null/>
|
||||||
|
<not-uninit/>
|
||||||
|
</arg>
|
||||||
|
</function>
|
||||||
<!-- https://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Options.html#Getopt-Long-Options -->
|
<!-- https://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Options.html#Getopt-Long-Options -->
|
||||||
<!-- int getopt_long(int argc, char * const argv[],
|
<!-- int getopt_long(int argc, char * const argv[],
|
||||||
const char *optstring,
|
const char *optstring,
|
||||||
|
|
|
@ -3970,46 +3970,6 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
|
||||||
<not-bool/>
|
<not-bool/>
|
||||||
</arg>
|
</arg>
|
||||||
</function>
|
</function>
|
||||||
<!-- https://man7.org/linux/man-pages/man3/gethostbyaddr_r.3.html -->
|
|
||||||
<!-- int gethostbyaddr_r(const void *addr, socklen_t len, int type, struct hostent *restrict ret, char *restrict buf, size_t buflen, struct hostent **restrict result, int *restrict h_errnop); -->
|
|
||||||
<function name="gethostbyaddr_r">
|
|
||||||
<returnValue type="int"/>
|
|
||||||
<noreturn>false</noreturn>
|
|
||||||
<use-retval/>
|
|
||||||
<pure/>
|
|
||||||
<arg nr="1" direction="in">
|
|
||||||
<not-uninit/>
|
|
||||||
<not-null/>
|
|
||||||
</arg>
|
|
||||||
<arg nr="2" direction="in">
|
|
||||||
<not-uninit/>
|
|
||||||
<valid>0:</valid>
|
|
||||||
</arg>
|
|
||||||
<arg nr="3" direction="in">
|
|
||||||
<not-uninit/>
|
|
||||||
</arg>
|
|
||||||
<arg nr="4" direction="out">
|
|
||||||
<not-null/>
|
|
||||||
</arg>
|
|
||||||
<arg nr="5" direction="in">
|
|
||||||
<not-uninit/>
|
|
||||||
<not-null/>
|
|
||||||
<minsize type="argvalue" arg="6"/>
|
|
||||||
</arg>
|
|
||||||
<arg nr="6" direction="in">
|
|
||||||
<not-uninit/>
|
|
||||||
<valid>0:</valid>
|
|
||||||
</arg>
|
|
||||||
<arg nr="7" direction="in">
|
|
||||||
<not-null/>
|
|
||||||
<not-uninit/>
|
|
||||||
</arg>
|
|
||||||
<arg nr="8" direction="in">
|
|
||||||
<not-null/>
|
|
||||||
<not-uninit/>
|
|
||||||
</arg>
|
|
||||||
</function>
|
|
||||||
|
|
||||||
<!-- void setkey(const char *key); -->
|
<!-- void setkey(const char *key); -->
|
||||||
<function name="setkey">
|
<function name="setkey">
|
||||||
<noreturn>false</noreturn>
|
<noreturn>false</noreturn>
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <error.h>
|
#include <error.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
|
||||||
void unreachableCode_error(void) // #11197
|
void unreachableCode_error(void) // #11197
|
||||||
{
|
{
|
||||||
|
@ -34,6 +35,37 @@ void unreachableCode_error(void) // #11197
|
||||||
int i;
|
int i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int nullPointer_gethostbyname2_r(const char* name, int af, struct hostent* ret, char* buf, size_t buflen, struct hostent** result, int* h_errnop)
|
||||||
|
{
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname2_r(NULL, af, ret, buf, buflen, result, h_errnop);
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname2_r(name, af, NULL, buf, buflen, result, h_errnop);
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname2_r(name, af, ret, NULL, buflen, result, h_errnop);
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname2_r(name, af, ret, buf, buflen, NULL, h_errnop);
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname2_r(name, af, ret, buf, buflen, result, NULL);
|
||||||
|
return gethostbyname2_r(name, af, ret, buf, buflen, result, h_errnop);
|
||||||
|
}
|
||||||
|
|
||||||
|
int nullPointer_gethostbyname_r(const char* name, struct hostent* ret, char* buf, size_t buflen, struct hostent** result, int* h_errnop)
|
||||||
|
{
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname_r(NULL, ret, buf, buflen, result, h_errnop);
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname_r(name, NULL, buf, buflen, result, h_errnop);
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname_r(name, ret, NULL, buflen, result, h_errnop);
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname_r(name, ret, buf, buflen, NULL, h_errnop);
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
|
(void) gethostbyname_r(name, ret, buf, buflen, result, NULL);
|
||||||
|
return gethostbyname_r(name, ret, buf, buflen, result, h_errnop);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int nullPointer_gethostbyaddr_r(const void* addr, socklen_t len, int type, struct hostent* ret, char* buf, size_t buflen, struct hostent** result, int* h_errnop)
|
int nullPointer_gethostbyaddr_r(const void* addr, socklen_t len, int type, struct hostent* ret, char* buf, size_t buflen, struct hostent** result, int* h_errnop)
|
||||||
{
|
{
|
||||||
// cppcheck-suppress nullPointer
|
// cppcheck-suppress nullPointer
|
||||||
|
|
Loading…
Reference in New Issue