Commit 6f1239c3 by Daniel Lezcano Committed by Daniel Lezcano

fix segfault when an unsupported personality is set

Bad array len computation. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 6371febf
...@@ -515,10 +515,11 @@ static int config_personality(const char *key, char *value, ...@@ -515,10 +515,11 @@ static int config_personality(const char *key, char *value,
{ "x86_64", PER_LINUX }, { "x86_64", PER_LINUX },
{ "amd64", PER_LINUX }, { "amd64", PER_LINUX },
}; };
size_t len = sizeof(pername) / sizeof(pername[0]);
int i; int i;
for (i = 0; i < sizeof(pername); i++) { for (i = 0; i < len; i++) {
if (strcmp(pername[i].name, value)) if (strcmp(pername[i].name, value))
continue; continue;
......
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