commit: r441 - in trunk: daemon include
[email protected] Fri, 06 Jan 2012 19:43:25 -0500
| Newsgroups | gmane.network.spread.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: jonathan Date: 2012-01-06 19:43:24 -0500 (Fri, 06 Jan 2012) New Revision: 441 Modified: trunk/daemon/Changelog trunk/daemon/scatter.h trunk/include/sp.h Log: Fix for crash/corruption bug on 64 bit platforms because of incorrect size of scatter/iovec structures. Affects public API as it updates sp.h scatter as well. Modified: trunk/daemon/Changelog =================================================================== --- trunk/daemon/Changelog 2012-01-06 05:36:08 UTC (rev 440) +++ trunk/daemon/Changelog 2012-01-07 00:43:24 UTC (rev 441) @@ -1,3 +1,13 @@ +Fri Jan 6 01:01:01 2012 Jonathan Stanton <[email protected]> + + * include/sp.h, scatter.h (dummy_scat_element): Fix scatter type + definition by replacing int with size_t. This fixes crash bug + when compiling on 64 bit platforms. + + The public sp.h include header pulls in size_t by including + <stddef.h> which is part of standard c headers and thus should + work on unix systems and windows. + Fri Jan 6 00:35:00 2012 Jonathan Stanton <[email protected]> * configure.in: Fix reported compile problem with Solaris Modified: trunk/daemon/scatter.h =================================================================== --- trunk/daemon/scatter.h 2012-01-06 05:36:08 UTC (rev 440) +++ trunk/daemon/scatter.h 2012-01-07 00:43:24 UTC (rev 441) @@ -43,16 +43,16 @@ typedef struct dummy_scat_element{ char *buf; - int len; + size_t len; } scat_element; typedef struct dummy_scatter { - int num_elements; + size_t num_elements; scat_element elements[ARCH_SCATTER_SIZE]; } sys_scatter; typedef struct dummy_big_scatter { - int num_elements; + size_t num_elements; scat_element elements[MAX_SCATTER_ELEMENTS]; } scatter; Modified: trunk/include/sp.h =================================================================== --- trunk/include/sp.h 2012-01-06 05:36:08 UTC (rev 440) +++ trunk/include/sp.h 2012-01-07 00:43:24 UTC (rev 441) @@ -37,6 +37,9 @@ #ifndef INC_SP #define INC_SP +/* for size_t */ +#include <stddef.h> + #ifdef __cplusplus extern "C" { #endif @@ -136,11 +139,11 @@ typedef struct dummy_scat_element{ char *buf; - int len; + size_t len; } scat_element; typedef struct dummy_scatter{ - int num_elements; + size_t num_elements; scat_element elements[MAX_CLIENT_SCATTER_ELEMENTS]; } scatter;