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

Commit 6d46ea2

Browse files
committed
Add one more byte to malloc for null storage.
1 parent 9fb5c75 commit 6d46ea2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/initdb/initdb.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1994, Regents of the University of California
4040
* Portions taken from FreeBSD.
4141
*
42-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.57 2004/10/07 16:53:25 momjian Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.58 2004/10/07 17:29:12 momjian Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -1909,7 +1909,7 @@ escape_locale(char **locale)
19091909
{
19101910
int len = strlen(*locale),
19111911
i, j;
1912-
char *loc_temp = xmalloc(len * 2);
1912+
char *loc_temp = xmalloc(len * 2 + 1);
19131913

19141914
for (i = 0, j = 0; i < len; i++)
19151915
{

0 commit comments

Comments
 (0)