Skip to content

Commit 08b0e60

Browse files
author
Neil Conway
committed
Fix a probably-harmless read of uninitialized memory in mkdir_p(), to
silence a valgrind warning.
1 parent 25b8b69 commit 08b0e60

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
@@ -43,7 +43,7 @@
4343
* Portions Copyright (c) 1994, Regents of the University of California
4444
* Portions taken from FreeBSD.
4545
*
46-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.20 2004/01/31 21:18:00 neilc Exp $
46+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.21 2004/01/31 22:10:00 neilc Exp $
4747
*
4848
*-------------------------------------------------------------------------
4949
*/
@@ -553,7 +553,7 @@ mkdir_p(char *path, mode_t omode)
553553
else if (p[0] != '/')
554554
continue;
555555
*p = '\0';
556-
if (p[1] == '\0')
556+
if (!last && p[1] == '\0')
557557
last = 1;
558558
if (first)
559559
{

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