svn commit: samba r16249 - branches/SAMBA_3_0/source/libsmb trunk/source/libsmb

vlendec at samba.org vlendec at samba.org
Thu Jun 15 10:48:53 GMT 2006


Author: vlendec
Date: 2006-06-15 10:48:53 +0000 (Thu, 15 Jun 2006)
New Revision: 16249

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16249

Log:
Fix Klokwork ID 130
Modified:
   branches/SAMBA_3_0/source/libsmb/clidfs.c
   trunk/source/libsmb/clidfs.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/clidfs.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/clidfs.c	2006-06-15 10:12:29 UTC (rev 16248)
+++ branches/SAMBA_3_0/source/libsmb/clidfs.c	2006-06-15 10:48:53 UTC (rev 16249)
@@ -415,7 +415,7 @@
 	/* strip a trailing backslash */
 	
 	len = strlen( newpath );
-	if ( newpath[len-1] == '\\' )
+	if ( (len > 0) && (newpath[len-1] == '\\') )
 		newpath[len-1] = '\0';
 		
 	pstrcpy( clean, newpath );

Modified: trunk/source/libsmb/clidfs.c
===================================================================
--- trunk/source/libsmb/clidfs.c	2006-06-15 10:12:29 UTC (rev 16248)
+++ trunk/source/libsmb/clidfs.c	2006-06-15 10:48:53 UTC (rev 16249)
@@ -416,7 +416,7 @@
 	/* strip a trailing backslash */
 	
 	len = strlen( newpath );
-	if ( newpath[len-1] == '\\' )
+	if ( (len > 0) && (newpath[len-1] == '\\') )
 		newpath[len-1] = '\0';
 		
 	pstrcpy( clean, newpath );



More information about the samba-cvs mailing list