Hi, When compiling plbuf.c, MS Visual Studio 9 2008 issues the following warning
plbuf.c(1159) : warning C4700: uninitialized local variable 'new_state' used.
This occurs in -
void plbuf_restore(PLStream *pls, void *state)
{
struct _state *new_state;
(plbuf.c line 1154)
#ifdef BUFFERED_FILE
pls->plbufFile = new_state->save_file;
#else
pls->plbuf_buffer = new_state->plbuf_buffer;
(plbuf.c line 1159)
pls->plbuf_buffer_size = new_state->plbuf_buffer_size;
pls->plbuf_top = new_state->plbuf_top;
pls->plbuf_readpos = new_state->plbuf_readpos;
#endif
/* cmap 0 */
pls->cmap0 = new_state->color_map[0].cmap;
pls->icol0 = new_state->color_map[0].icol;
pls->ncol0 = new_state->color_map[0].ncol;
/* cmap 1 */
pls->cmap1 = new_state->color_map[1].cmap;
pls->icol1 = new_state->color_map[1].icol;
pls->ncol1 = new_state->color_map[1].ncol;
}
I don't have a test case but inspecting the code suggests that if plbuf_restore
is called this would give rise to errors in the color maps and further memory
corruption.
new_state should be initialised in line 1154 as follows
struct _state *new_state = (struct _state *)state;
Note plbuf_restore is called by plbuf_switch.
Kind regards
Terrence
Send instant messages to your online friends http://uk.messenger.yahoo.com
plbuf.patch
Description: Binary data
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
