From e8a09023209233bd957015a0361d23d8aaef7a54 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Fri, 12 Jan 2018 12:26:43 +0900 Subject: [PATCH] Fix a bug in is_setting_search_path. A pointer might be incremented to point beyond the null terminator. Report and patch by Grant Shirreffs. --- connection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/connection.c b/connection.c index c945549..ed51e02 100644 --- a/connection.c +++ b/connection.c @@ -1601,7 +1601,7 @@ is_setting_search_path(const char *query) return FALSE; q += 3; while (isspace(*q)) q++; - for (; *q; q++) + for (; *q;) { if (IS_NOT_SPACE(*q)) { @@ -1611,6 +1611,8 @@ is_setting_search_path(const char *query) while (IS_NOT_SPACE(*q)) q++; } + else + q++; } return FALSE; } -- 2.39.5