Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fa877ed

Browse files
committed
Safe guard in case of imporper data is provided to elog()
in multi-byte build.
1 parent 62e4827 commit fa877ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/utils/error/elog.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.80 2001/01/24 19:43:15 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.81 2001/02/21 06:05:23 ishii Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -683,6 +683,8 @@ write_syslog(int level, const char *line)
683683
#ifdef MULTIBYTE
684684
/* trim to multibyte letter boundary */
685685
buflen = pg_mbcliplen(buf, l, l);
686+
if (buflen <= 0)
687+
return;
686688
buf[buflen] = '\0';
687689
l = strlen(buf);
688690
#endif

0 commit comments

Comments
 (0)