~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a missing error check in pterm's child-process setup. Shouldn't
[sgt/putty]
/
conf.c
diff --git
a/conf.c
b/conf.c
index
7b6a013
..
e80f585
100644
(file)
--- a/
conf.c
+++ b/
conf.c
@@
-522,14
+522,15
@@
int conf_deserialise(Conf *conf, void *vdata, int maxsize)
unsigned char *data = (unsigned char *)vdata;
unsigned char *start = data;
struct conf_entry *entry;
unsigned char *data = (unsigned char *)vdata;
unsigned char *start = data;
struct conf_entry *entry;
- int primary, used;
+ unsigned primary;
+ int used;
unsigned char *zero;
while (maxsize >= 4) {
primary = GET_32BIT_MSB_FIRST(data);
data += 4, maxsize -= 4;
unsigned char *zero;
while (maxsize >= 4) {
primary = GET_32BIT_MSB_FIRST(data);
data += 4, maxsize -= 4;
- if (
(unsigned)
primary >= N_CONFIG_OPTIONS)
+ if (primary >= N_CONFIG_OPTIONS)
break;
entry = snew(struct conf_entry);
break;
entry = snew(struct conf_entry);
@@
-541,7
+542,7
@@
int conf_deserialise(Conf *conf, void *vdata, int maxsize)
sfree(entry);
goto done;
}
sfree(entry);
goto done;
}
- entry->key.secondary.i =
GET_32BIT_MSB_FIRST(data
);
+ entry->key.secondary.i =
toint(GET_32BIT_MSB_FIRST(data)
);
data += 4, maxsize -= 4;
break;
case TYPE_STR:
data += 4, maxsize -= 4;
break;
case TYPE_STR:
@@
-564,7
+565,7
@@
int conf_deserialise(Conf *conf, void *vdata, int maxsize)
sfree(entry);
goto done;
}
sfree(entry);
goto done;
}
- entry->value.u.intval =
GET_32BIT_MSB_FIRST(data
);
+ entry->value.u.intval =
toint(GET_32BIT_MSB_FIRST(data)
);
data += 4, maxsize -= 4;
break;
case TYPE_STR:
data += 4, maxsize -= 4;
break;
case TYPE_STR: