diff options
-rw-r--r-- | apps/wps-display.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/wps-display.c b/apps/wps-display.c index 8afb803856..e7c5472ea9 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c | |||
@@ -854,9 +854,14 @@ static void format_display(char* buf, | |||
854 | } | 854 | } |
855 | #endif | 855 | #endif |
856 | /* skip the tag */ | 856 | /* skip the tag */ |
857 | /* WARNING! This will crash if there's a syntax error in the wps file */ | ||
858 | for (n = 0; n < 4; n++) { | 857 | for (n = 0; n < 4; n++) { |
859 | fmt = strchr(fmt+1, '|'); /* get the next '|' */ | 858 | char *ptr; |
859 | ptr = strchr(fmt+1, '|'); /* get the next '|' */ | ||
860 | if(ptr) | ||
861 | fmt=ptr; | ||
862 | else | ||
863 | /* syntax error, bail out of loop */ | ||
864 | break; | ||
860 | } | 865 | } |
861 | fmt++; | 866 | fmt++; |
862 | break; | 867 | break; |