X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fmono-networkinterfaces.c;h=fc5bcc966a7105f964abe575254493d9498aa50b;hb=bc9d5d113ab7064fc199a2f430751643466cb477;hp=da0f5de0046b9f12372474057a0cfd01003a6b6b;hpb=e946a6cdebde729e1c03ec374184254ab38da184;p=mono.git diff --git a/mono/utils/mono-networkinterfaces.c b/mono/utils/mono-networkinterfaces.c index da0f5de0046..fc5bcc966a7 100644 --- a/mono/utils/mono-networkinterfaces.c +++ b/mono/utils/mono-networkinterfaces.c @@ -46,7 +46,7 @@ mono_networkinterface_list (int *size) count *= 2; } - nilist = g_realloc (nilist, count * sizeof (void*)); + nilist = (void **) g_realloc (nilist, count * sizeof (void*)); nilist [i++] = g_strdup (name); } @@ -56,7 +56,7 @@ mono_networkinterface_list (int *size) *size = i; if (!nilist) - nilist = g_malloc (sizeof (void*)); + nilist = (void **) g_malloc (sizeof (void*)); nilist [i] = NULL; return nilist; } @@ -97,9 +97,8 @@ mono_network_get_data (char* name, MonoNetworkData data, MonoNetworkError *error char *ptr; buf [sizeof (buf) - 1] = 0; - /* FIXME: This might potentially cause a buffer overflow for cname. */ if ((ptr = strchr (buf, ':')) == NULL || - (*ptr++ = 0, sscanf (buf, "%s", cname) != 1)) + (*ptr++ = 0, sscanf (buf, "%250s", cname) != 1)) goto out; if (strcmp (name, cname) != 0) continue;