[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Confuse-devel] [PATCH 2/3] confuse: do not move to a NULL buffer
From: |
Carlo Marcelo Arenas Belon |
Subject: |
[Confuse-devel] [PATCH 2/3] confuse: do not move to a NULL buffer |
Date: |
Thu, 1 Jan 2009 17:24:25 -0800 |
avoids a segfault when processing a buffer that called cfg_include
Signed-off-by: Carlo Marcelo Arenas Belon <address@hidden>
---
src/lexer.l | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/lexer.l b/src/lexer.l
index 1e0fa91..bb996cd 100644
--- a/src/lexer.l
+++ b/src/lexer.l
@@ -342,7 +342,8 @@ void cfg_scan_string_end(void)
/* restore to previous state
*/
yy_delete_buffer(string_scan_state);
- yy_switch_to_buffer(pre_string_scan_state);
+ if (pre_string_scan_state)
+ yy_switch_to_buffer(pre_string_scan_state);
free(cfg_qstring);
cfg_qstring = 0;
qstring_index = qstring_len = 0;