提交 53edb8dc 编写于 作者: T Tatsuo Ishii

Fix psql crash while parsing SQL file whose encoding is different from

client encoding and the client encoding is not *safe* one. Such an
example is, file encoding is UTF-8 and client encoding SJIS. Patch
contributed by Jiang Guiqing.
上级 c35fea10
......@@ -1807,7 +1807,7 @@ prepare_buffer(const char *txt, int len, char **txtcopy)
/* first byte should always be okay... */
newtxt[i] = txt[i];
i++;
while (--thislen > 0)
while (--thislen > 0 && i < len)
newtxt[i++] = (char) 0xFF;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册