gnu.cfg: Ensure a nullPointer warning is shown for invalid input to mempcpy() and wmempcpy().
This commit is contained in:
parent
ce369c5122
commit
7c766a9696
|
@ -16,10 +16,29 @@
|
|||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/mman.h>
|
||||
#include <wchar.h>
|
||||
#ifndef __CYGWIN__
|
||||
#include <sys/epoll.h>
|
||||
#endif
|
||||
|
||||
void *nullPointer_mempcpy(void *dest, const void *src, size_t n)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) mempcpy(NULL,src,n);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) mempcpy(dest,NULL,n);
|
||||
return mempcpy(dest,src,n);
|
||||
}
|
||||
|
||||
wchar_t *nullPointer_wmempcpy(wchar_t *dest, const wchar_t *src, size_t n)
|
||||
{
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) wmempcpy(NULL,src,n);
|
||||
// cppcheck-suppress nullPointer
|
||||
(void) wmempcpy(dest,NULL,n);
|
||||
return wmempcpy(dest,src,n);
|
||||
}
|
||||
|
||||
int uninitvar_getpw(uid_t uid, char *buf)
|
||||
{
|
||||
uid_t someUid;
|
||||
|
|
Loading…
Reference in New Issue