From 587c1ef949cce26be9e528414b8b377a6598cb04 Mon Sep 17 00:00:00 2001 From: Takanori Nakane Date: Thu, 30 Oct 2014 14:02:59 +0900 Subject: Fix an infinite loop in the parsing of an event string. --- libcrystfel/src/events.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libcrystfel/src/events.c b/libcrystfel/src/events.c index b008eee6..29cb9495 100644 --- a/libcrystfel/src/events.c +++ b/libcrystfel/src/events.c @@ -412,16 +412,13 @@ struct event *get_event_from_event_string(const char *ev_string) if ( ev == NULL ) return NULL; if ( strlen(buf_path) !=0 ) { - + start = buf_path; do { - - start = buf_path; - char buf[2014]; sep = strstr(start, "/"); - if ( sep != NULL ) { + if ( sep != NULL ) { strncpy(buf, start, sep-start); buf[sep-start]='\0'; push_path_entry_to_event(ev, buf); @@ -462,6 +459,7 @@ struct event *get_event_from_event_string(const char *ev_string) push_dim_entry_to_event(ev, buf_int); } + } while (sep); } -- cgit v1.2.3