projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix up potential overflows in size calculations by replacing
[pspp]
/
src
/
inpt-pgm.c
diff --git
a/src/inpt-pgm.c
b/src/inpt-pgm.c
index 004fe2c4820b3b7e74b01118e161e8d9070ac02f..eb2503c79e7ce616a5bc6780a8837326a124bf42 100644
(file)
--- a/
src/inpt-pgm.c
+++ b/
src/inpt-pgm.c
@@
-14,8
+14,8
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
#include <config.h>
#include "error.h"
#include <config.h>
#include "error.h"
@@
-36,6
+36,9
@@
#include "var.h"
#include "vfm.h"
#include "var.h"
#include "vfm.h"
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
#include "debug-print.h"
/* Indicates how a `union value' should be initialized. */
#include "debug-print.h"
/* Indicates how a `union value' should be initialized. */
@@
-65,8
+68,7
@@
cmd_input_program (void)
/* FIXME: we shouldn't do this here, but I'm afraid that other
code will check the class of vfm_source. */
/* FIXME: we shouldn't do this here, but I'm afraid that other
code will check the class of vfm_source. */
- vfm_source = create_case_source (&input_program_source_class,
- default_dict, NULL);
+ vfm_source = create_case_source (&input_program_source_class, NULL);
return lex_end_of_command ();
}
return lex_end_of_command ();
}
@@
-94,7
+96,7
@@
cmd_end_input_program (void)
/* Figure out how to initialize each input case. */
inp = xmalloc (sizeof *inp);
inp->init_cnt = dict_get_next_value_idx (default_dict);
/* Figure out how to initialize each input case. */
inp = xmalloc (sizeof *inp);
inp->init_cnt = dict_get_next_value_idx (default_dict);
- inp->init = x
malloc (inp->init_cnt *
sizeof *inp->init);
+ inp->init = x
nmalloc (inp->init_cnt,
sizeof *inp->init);
for (i = 0; i < inp->init_cnt; i++)
inp->init[i] = -1;
for (i = 0; i < dict_get_var_cnt (default_dict); i++)
for (i = 0; i < inp->init_cnt; i++)
inp->init[i] = -1;
for (i = 0; i < dict_get_var_cnt (default_dict); i++)
@@
-116,9
+118,6
@@
cmd_end_input_program (void)
/* Put inp into vfm_source for later use. */
vfm_source->aux = inp;
/* Put inp into vfm_source for later use. */
vfm_source->aux = inp;
- /* FIXME: we should use create_case_source() here. */
- vfm_source->value_cnt = dict_get_next_value_idx (default_dict);
-
return lex_end_of_command ();
}
return lex_end_of_command ();
}