diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2018-10-29 15:39:48 +0000 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-11-02 12:32:07 +0100 |
commit | 06a45458a3618da69385eeda55bd8b64d6dd547f (patch) | |
tree | de0556376b94ddeff58154e783d55b0d2b5a530a | |
parent | c3fc97285416da124059433c9edb91796ee5e010 (diff) | |
download | sparse-06a45458a3618da69385eeda55bd8b64d6dd547f.tar.gz |
tokenize: check show_string() for NULL pointer
Fix issue where show_string() being passed a NULL pointer by accident.
This only happened during debugging, but would be a useful addition to
the checks in this function.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | tokenize.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -124,7 +124,7 @@ const char *show_string(const struct string *string) char *ptr; int i; - if (!string->length) + if (!string || !string->length) return "<bad_string>"; ptr = buffer; *ptr++ = '"'; |