Commit 626040b1 authored by Thomas Faber's avatar Thomas Faber Committed by Alexandre Julliard

ws2_32: Avoid a variable-length array.

parent b1b92046
...@@ -3337,12 +3337,13 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, ...@@ -3337,12 +3337,13 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
#endif #endif
#ifdef HAS_IRDA #ifdef HAS_IRDA
#define MAX_IRDA_DEVICES 10
case WS_SOL_IRLMP: case WS_SOL_IRLMP:
switch(optname) switch(optname)
{ {
case WS_IRLMP_ENUMDEVICES: case WS_IRLMP_ENUMDEVICES:
{ {
static const int MAX_IRDA_DEVICES = 10;
char buf[sizeof(struct irda_device_list) + char buf[sizeof(struct irda_device_list) +
(MAX_IRDA_DEVICES - 1) * sizeof(struct irda_device_info)]; (MAX_IRDA_DEVICES - 1) * sizeof(struct irda_device_info)];
int res; int res;
...@@ -3402,6 +3403,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, ...@@ -3402,6 +3403,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
return SOCKET_ERROR; return SOCKET_ERROR;
} }
break; /* case WS_SOL_IRLMP */ break; /* case WS_SOL_IRLMP */
#undef MAX_IRDA_DEVICES
#endif #endif
/* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */ /* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment