summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index a6994b8..cea36f7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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);