diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2011-10-31 11:21:38 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-10-31 11:21:38 -0400 |
commit | e742dcc9ed4b22eb5191f7e8d2b7cd8011ed5893 (patch) | |
tree | c7a51f586a7e44a67b3b4d7ef925e2b1b84f9c13 /src | |
parent | 3f1063f92aa60cf93bca6a6b15a7f782b8df8f93 (diff) |
scanner: Check name == NULL for enum entries
From a clang static analysis warning.
Diffstat (limited to 'src')
-rw-r--r-- | src/scanner.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/scanner.c b/src/scanner.c index 07d1edf..5f85396 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -267,6 +267,9 @@ start_element(void *data, const char *element_name, const char **atts) ctx->enumeration = enumeration; } else if (strcmp(element_name, "entry") == 0) { + if (name == NULL) + fail(ctx, "no entry name given"); + entry = malloc(sizeof *entry); entry->name = strdup(name); entry->uppercase_name = uppercase_dup(name); |