diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2016-01-22 19:07:52 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-01-28 13:30:14 +0000 |
commit | 62968599557ac81b0f811481f6b06886ddcf0cdb (patch) | |
tree | b3c022332d8b29bf00c7a72c4ee400ccdf09b9e9 /src | |
parent | a6bbd1d7f5c25b092f143b579860a44e5b0f929e (diff) | |
download | odhcp6c-62968599557ac81b0f811481f6b06886ddcf0cdb.tar.gz |
Fix off-by-one in buffer length in int_to_env
We need to allow for '=', negative sign, 10 digits and the null
terminator, adding up to 13 bytes not 12.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/script.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script.c b/src/script.c index 83fbea5..89cb0d6 100644 --- a/src/script.c +++ b/src/script.c @@ -227,7 +227,7 @@ static void search_to_env(const char *name, const uint8_t *start, size_t len) static void int_to_env(const char *name, int value) { - size_t len = 12 + strlen(name); + size_t len = 13 + strlen(name); char *buf = realloc(NULL, len); snprintf(buf, len, "%s=%d", name, value); putenv(buf); |