summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-11-04 18:15:30 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2010-11-04 18:15:30 +0100
commitdf38cbc7b0f06bccb45135e621232f0d287aa5b2 (patch)
tree5c30a9477f5b1e395a2ff1f94ecd87981ef68345 /lib
parent5f9275551face64bbf28e157ecd717619493788f (diff)
downloadabrt-df38cbc7b0f06bccb45135e621232f0d287aa5b2.tar.gz
abrt-df38cbc7b0f06bccb45135e621232f0d287aa5b2.tar.xz
abrt-df38cbc7b0f06bccb45135e621232f0d287aa5b2.zip
fix a simple bug in run_event() - was truncating command at first word
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/utils/run_event.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/utils/run_event.c b/lib/utils/run_event.c
index e89d1040..45e4bf86 100644
--- a/lib/utils/run_event.c
+++ b/lib/utils/run_event.c
@@ -57,13 +57,16 @@ int run_event(struct run_event_state *state,
{
char *end_word = skip_non_whitespace(p);
char *next_word = skip_whitespace(end_word);
- *end_word = '\0';
+
+ /* *end_word = '\0'; - BUG, truncates command */
/* If there is no '=' in this word... */
char *line_val = strchr(p, '=');
- if (!line_val)
+ if (!line_val || line_val >= end_word)
break; /* ...we found the start of a command */
+ *end_word = '\0';
+
/* Current word has VAR=VAL form. line_val => VAL */
*line_val++ = '\0';