mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Safe guard in case of imporper data is provided to elog()
in multi-byte build.
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.80 2001/01/24 19:43:15 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.81 2001/02/21 06:05:23 ishii Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -683,6 +683,8 @@ write_syslog(int level, const char *line)
|
|||||||
#ifdef MULTIBYTE
|
#ifdef MULTIBYTE
|
||||||
/* trim to multibyte letter boundary */
|
/* trim to multibyte letter boundary */
|
||||||
buflen = pg_mbcliplen(buf, l, l);
|
buflen = pg_mbcliplen(buf, l, l);
|
||||||
|
if (buflen <= 0)
|
||||||
|
return;
|
||||||
buf[buflen] = '\0';
|
buf[buflen] = '\0';
|
||||||
l = strlen(buf);
|
l = strlen(buf);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user