From: John Darrington Date: Sun, 19 Feb 2012 08:48:31 +0000 (+0100) Subject: ODS Reader: fix uninitialised variables X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fbuilds%2F20120219030503%2Fpspp;p=pspp ODS Reader: fix uninitialised variables --- diff --git a/src/data/ods-reader.c b/src/data/ods-reader.c index ea8b9ad56b..122e98c76d 100644 --- a/src/data/ods-reader.c +++ b/src/data/ods-reader.c @@ -411,8 +411,10 @@ ods_open_reader (struct spreadsheet_read_info *gri, struct dictionary **dict) /* If CELLRANGE was given, then we know how many variables should be read */ if ( r->stop_col != -1 ) { + assert (var_spec == NULL); n_var_specs = r->stop_col - r->start_col + 1; var_spec = xrealloc (var_spec, sizeof (*var_spec) * n_var_specs); + memset (var_spec, '\0', sizeof (*var_spec) * n_var_specs); }