[PATCH] check for p

Marcus Meissner marcus at jet.franken.de
Thu Feb 8 15:06:52 CST 2007


Hi,

Spotted by Coverity.... While
in general this should get a directory with
a /, it might not for some reason.

Ciao, Marcus
---
 server/request.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/request.c b/server/request.c
index c01a70e..925290e 100644
--- a/server/request.c
+++ b/server/request.c
@@ -545,12 +545,12 @@ static void create_server_dir( const cha
     /* first create the base directory if needed */
 
     p = strrchr( server_dir, '/' );
-    *p = 0;
+    if (p) *p = 0;
     create_dir( server_dir, &st );
 
     /* now create the server directory */
 
-    *p = '/';
+    if (p) *p = '/';
     create_dir( server_dir, &st );
 
     if (chdir( server_dir ) == -1) fatal_perror( "chdir %s", server_dir );
-- 
1.4.3.4



More information about the wine-patches mailing list