Skip to content

Commit cfde871

Browse files
committed
Update xshared.c
1 parent aaafda4 commit cfde871

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ipthelper/xshared.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#ifndef _GNU_SOURCE
2+
#define _GNU_SOURCE 1
3+
#endif
4+
15
#include <ctype.h>
26
#include <getopt.h>
37
#include <errno.h>
@@ -64,7 +68,13 @@ static bool xs_option_name_pointer_is_valid(const char *name)
6468
#else
6569
static bool xs_option_name_pointer_is_valid(const char *name)
6670
{
67-
(void)name;
71+
if (name == NULL)
72+
return true;
73+
74+
#if INTPTR_MAX > 0xffffffff
75+
if ((uintptr_t)name < 0x100000000ULL)
76+
return false;
77+
#endif
6878
return true;
6979
}
7080
#endif

0 commit comments

Comments
 (0)