Properly skip over quoted values
PATCH 1/1 Properly skip over quoted values
Otherwise a left paren in a string can bring an obscure segfault.
--- gatchat/gatresult.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
gatchat/gatresult.c +11 -0
@@ -361,6 +361,17 @@ static gint skip_until(const char *line, int start, const char delim)if (line[i] == delim)return i; +if (line[i] =='\"' ) { + i +=1 ; +while (i < len && line[i] !='\"' ) + i +=1 ; + +if (i < len) + i +=1 ; + +continue ; + } +if (line[i] !='(' ) { i +=1 ;continue ;
Signature · 1 line
1.6.1
Hi Andrew,
gatchat/gatresult.c static gint skip_until(const char *line, int start, const char delim) · line 374
Quoted 13 lines
Otherwise a left paren in a string can bring an obscure segfault.
---gatchat/gatresult.c +11
-0+if (line[i] =='\"' ) { + i +=1 ; +while (i < len && line[i] !='\"' ) + i +=1 ; + +if (i < len) + i +=1 ; + +continue ; + } +
I suggest you recursively call skip_until here instead of duplicating the code. It also should be moved down and treated like '(' and ')'
Regards,
-Denis
Nevermind, I see why you did it this way. Patch has been applied.
Regards,
-Denis