From: Nick Mathewson Date: Fri, 6 Nov 2009 17:12:39 +0000 (+0000) Subject: Fix a miscalculated realloc() size in win32select.c. X-Git-Tag: release-2.0.3-alpha~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ec43fe446d399464125d7cc0d5d1182756c953f;p=libevent Fix a miscalculated realloc() size in win32select.c. This bug was introduced by the code to make the backend able to safely release the base lock while calling select(). Also, we change win32select.c to the same 32-fds-to-start default as the rest of the backends, so that the main/many_events test can test it. It was at 64-to-start, so the test wasn't hitting it. svn:r1513 --- diff --git a/win32select.c b/win32select.c index f90fa925..d8d15f2c 100644 --- a/win32select.c +++ b/win32select.c @@ -177,7 +177,7 @@ do_fd_clear(struct event_base *base, return (0); } -#define NEVENT 64 +#define NEVENT 32 void * win32_init(struct event_base *_base) { @@ -284,7 +284,7 @@ win32_dispatch(struct event_base *base, struct timeval *tv) SOCKET s; if (win32op->resize_out_sets) { - size_t size = win32op->fd_setsz; + size_t size = FD_SET_ALLOC_SIZE(win32op->fd_setsz); if (!(win32op->readset_out = mm_realloc(win32op->readset_out, size))) return (-1); if (!(win32op->exset_out = mm_realloc(win32op->exset_out, size)))