summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index b5d3a32..a126e8a 100644
--- a/parser.c
+++ b/parser.c
@@ -1222,6 +1222,11 @@ static int Go_int_eprom_48(gchar** response, int channel, char *loc_string,char
switch (command_type) {
case command_param_units:
the_number=(short) atoi(store_string);
+
+ if ((the_number < 0) || (the_number > 0xffff)) {
+ return OutOfRange;
+ }
+
*(short *)(&globals.Flash.flash_start + eprom_loc) = the_number;
writeUserBlock(&globals.Flash, eprom_loc, sizeof (the_number));
return OK;
@@ -1291,6 +1296,11 @@ static int Go_char_eprom_70(gchar** response, int channel, char *loc_string,char
switch (command_type) {
case command_param_units:
the_number=(char) atoi(store_string);
+
+ if ((the_number < 0) || (the_number > 0xff)) {
+ return OutOfRange;
+ }
+
*(char *)(&globals.Flash.flash_start + eprom_loc)=the_number;
writeUserBlock(&globals.Flash, eprom_loc, sizeof(the_number));