Commit e2b577e5e548b58740ed5b1d9d12015cb7b233ff
1 parent
926acf8f
Prevent segfaulting when -clock is specified multiple times.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3181 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
1 additions
and
1 deletions
vl.c
@@ -903,7 +903,7 @@ static void configure_alarms(char const *opt) | @@ -903,7 +903,7 @@ static void configure_alarms(char const *opt) | ||
903 | while (name) { | 903 | while (name) { |
904 | struct qemu_alarm_timer tmp; | 904 | struct qemu_alarm_timer tmp; |
905 | 905 | ||
906 | - for (i = 0; i < count; i++) { | 906 | + for (i = 0; i < count && alarm_timers[i].name; i++) { |
907 | if (!strcmp(alarm_timers[i].name, name)) | 907 | if (!strcmp(alarm_timers[i].name, name)) |
908 | break; | 908 | break; |
909 | } | 909 | } |