[HQ-93] un-clobber stack data in sigar_gethostbyname
This commit is contained in:
1 parent
f1a13a3361
commit
5c26b463d9
4 files changed
+42
-28
No files matched your search
@@ -239,4 +239,23 @@ int sigar_get_iftype(const char *name, int *type, int *inst);
|
||||
#define SIGAR_NIC_ETHERNET "Ethernet"
|
||||
#define SIGAR_NIC_NETROM "AMPR NET/ROM"
|
||||
|
||||
#ifdef WIN32
|
||||
#else
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#define SIGAR_GETHOSTBYNAME_LEN 512
|
||||
#if defined(__hpux) || defined(_AIX)
|
||||
#define SIGAR_HAS_HOSTENT_DATA
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char buffer[SIGAR_GETHOSTBYNAME_LEN];
|
||||
struct hostent hs;
|
||||
int error;
|
||||
#ifdef SIGAR_HAS_HOSTENT_DATA
|
||||
struct hostent_data hd;
|
||||
#endif
|
||||
} sigar_hostent_t;
|
||||
|
||||
#endif
|
||||
@@ -30,7 +30,8 @@
|
||||
|
||||
char *sigar_uitoa(char *buf, unsigned int n, int *len);
|
||||
|
||||
struct hostent *sigar_gethostbyname(const char *name);
|
||||
struct hostent *sigar_gethostbyname(const char *name,
|
||||
sigar_hostent_t *data);
|
||||
|
||||
SIGAR_INLINE char *sigar_skip_line(char *buffer, int buflen);
|
||||
|
||||
|
||||
Reference in new issue
Block a user