Commit 53807b1e authored by Jan Včelák's avatar Jan Včelák 🚀

keymgr, fix key size parsing

parent f3eb13a8
......@@ -169,13 +169,13 @@ int value_key_size(int argc, char *argv[], const parameter_t *p, void *data)
return -1;
}
unsigned *key_size = data + p->offset;
uint16_t *key_size = data + p->offset;
char *input = argv[0];
errno = 0;
char *end = NULL;
unsigned long value = strtoul(input, &end, 10);
if (*end != '\0' || errno != 0) {
if (*end != '\0' || errno != 0 || value > UINT16_MAX) {
error("Invalid key size.");
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment