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

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy