From cf4a74a0d6b17bf1c6582835a7fceaec7ad4115d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sun, 28 Aug 2011 00:07:48 +0200 Subject: [PATCH] PQF parsing: handle \\\0 sequence A truncated PQF term, backslash as last character, would resolve in read one byte beyond end of string. --- src/pquery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pquery.c b/src/pquery.c index a0fde12..749ce02 100644 --- a/src/pquery.c +++ b/src/pquery.c @@ -84,7 +84,7 @@ static int query_token(struct yaz_pqf_parser *li) } while (**qptr && **qptr != sep_char) { - if (**qptr == '\\') + if (**qptr == '\\' && (*qptr)[1]) { ++(li->lex_len); ++(*qptr); -- 1.7.10.4