diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2021-05-02 17:48:49 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2021-05-02 17:48:49 +0200 |
commit | df2340e48d0a79d06e77bb8913c35c8dd39fdc52 (patch) | |
tree | d751c8f8419e948449be98aaa7c124e11f1f871f | |
parent | a5279bffaf4ac2a97c5a443978a2abb4189eb765 (diff) | |
download | 0xFFFF-df2340e48d0a79d06e77bb8913c35c8dd39fdc52.tar.bz2 |
main: Fix NULL pointer derefernce
-rw-r--r-- | src/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |