diff options
author | Naohiro Ooiwa <nooiwa@miraclelinux.com> | 2009-06-28 14:30:38 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-28 14:30:38 +0300 |
commit | d80d146b2c78a9ea114748129cde0fae017bbfbc (patch) | |
tree | 5dda449aa7ad1542f8025f46b8f12d1e8743c1a9 /src/main.c | |
parent | cf07f316b773f552dbebeeac4a1220e8e7c968d0 (diff) | |
download | cflow-d80d146b2c78a9ea114748129cde0fae017bbfbc.tar.gz cflow-d80d146b2c78a9ea114748129cde0fae017bbfbc.tar.bz2 |
Fix coredump (tiny change)
* src/main.c (symbol_override): Fix conditional logic to prevent
coredump on invalid usage. Require that the argument always have
':' in it.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,3 +1,3 @@ /* This file is part of GNU cflow - Copyright (C) 1997,2005,2007 Sergey Poznyakoff + Copyright (C) 1997,2005,2007,2009 Sergey Poznyakoff @@ -259,3 +259,6 @@ symbol_override(const char *str) ptr = strchr(str, ':'); - if (*ptr == ':') { + if (!ptr) { + error(0, 0, _("%s: no symbol type supplied"), str); + return; + } else { type = find_option_type(symbol_optype, ptr+1, 0); @@ -265,4 +268,3 @@ symbol_override(const char *str) } - } else - type = IDENTIFIER; + } name = strndup(str, ptr - str); |