Browse code

core: reset cur_opt shortcut after use, it points to local variable

- safety to prevent invalid access on future extensions

Daniel-Constantin Mierla authored on 30/06/2014 10:05:19
Showing 1 changed files
... ...
@@ -732,7 +732,8 @@ int sr_cfg_parse(cfg_parser_t* st)
732 732
 			}
733 733
 
734 734
 			st->cur_opt = &t;
735
-			if (process_option(st, opt) < 0) return -1;
735
+			if (process_option(st, opt) < 0) { st->cur_opt = 0; return -1; }
736
+			st->cur_opt = 0;
736 737
 			break;
737 738
 
738 739
 		case '[':