summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2021-05-02 17:48:49 +0200
committerPali Rohár <pali.rohar@gmail.com>2021-05-02 17:48:49 +0200
commitdf2340e48d0a79d06e77bb8913c35c8dd39fdc52 (patch)
treed751c8f8419e948449be98aaa7c124e11f1f871f
parenta5279bffaf4ac2a97c5a443978a2abb4189eb765 (diff)
download0xFFFF-df2340e48d0a79d06e77bb8913c35c8dd39fdc52.tar.bz2
main: Fix NULL pointer derefernce
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 55467ca..5a1cc35 100644
--- a/src/main.c
+++ b/src/main.c
@@ -182,8 +182,10 @@ static void parse_image_arg(char * arg, struct image_list ** image_first) {
*(parts++) = 0;
layout_file = parts;
- while ( ( ptr = strchr(layout_file, '%') ) )
- layout_file = ptr+1;
+ if ( layout_file ) {
+ while ( ( ptr = strchr(layout_file, '%') ) )
+ layout_file = ptr+1;
+ }
type = NULL;
device = NULL;