diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2016-01-10 14:32:43 +0100 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2016-01-10 14:32:43 +0100 |
commit | 3c1ab9934d91dfe04ecc29146625ffd3e900a38e (patch) | |
tree | 4251a3ce12c968dadbfd97c2d4ca29d49536b239 | |
parent | b48b9b558c89783f812e6afbcdecb9d2a2153ad4 (diff) | |
download | 0xFFFF-3c1ab9934d91dfe04ecc29146625ffd3e900a38e.tar.bz2 |
main: Check for SW rel version length
-rw-r--r-- | src/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -834,9 +834,16 @@ int main(int argc, char **argv) { char * swver = strchr(fiasco_gen_arg, '%'); if ( swver ) *(swver++) = 0; + if ( swver && strlen(swver) >= sizeof(fiasco_out->swver) ) { + ERROR("SW rel version is too long"); + ret = 1; + goto clean; + } fiasco_out = fiasco_alloc_empty(); if ( ! fiasco_out ) { ERROR("Cannot write images to fiasco file %s", fiasco_gen_arg); + ret = 1; + goto clean; } else { if ( swver ) strcpy(fiasco_out->swver, swver); |