Fix a bug in is_setting_search_path. A pointer might be incremented to point beyond...
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Fri, 12 Jan 2018 03:26:43 +0000 (12:26 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Fri, 12 Jan 2018 03:26:43 +0000 (12:26 +0900)
Report and patch by Grant Shirreffs.

connection.c

index c945549f07b73b59c89276b034c04ec45e380b61..ed51e02fd4ae8c9ee4a25725ad6273bb820529f4 100644 (file)
@@ -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;
 }