33 lines
791 B
Plaintext
33 lines
791 B
Plaintext
$NetBSD: patch-aa,v 1.1.1.1 2011/12/05 15:13:33 oht Exp $
|
|
patch-aa
|
|
--- plugin/pluginutil.c.orig 2011-09-25 13:59:56.000000000 +0200
|
|
+++ plugin/pluginutil.c 2011-12-02 08:20:31.000000000 +0100
|
|
@@ -6,7 +6,9 @@
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
#include <netdb.h>
|
|
-
|
|
+#ifndef NI_MAXHOST
|
|
+#define NI_MAXHOST 1025
|
|
+#endif
|
|
#include <npapi.h>
|
|
#include <npruntime.h>
|
|
|
|
@@ -143,6 +145,7 @@
|
|
if (!ai) return NULL;
|
|
|
|
char ip[NI_MAXHOST];
|
|
+ const char *ipp = &ip[0] ;
|
|
if (getnameinfo(ai->ai_addr, ai->ai_addrlen, ip, NI_MAXHOST,
|
|
NULL, 0, NI_NUMERICHOST) != 0) {
|
|
freeaddrinfo(firstAddrInfo);
|
|
@@ -150,7 +153,7 @@
|
|
}
|
|
freeaddrinfo(firstAddrInfo);
|
|
|
|
- return strdup(ip);
|
|
+ return strndup(ipp,NI_MAXHOST);
|
|
}
|
|
|
|
/**
|