svn commit: samba r14159 - in trunk/source/libsmb: .
ab at samba.org
ab at samba.org
Fri Mar 10 14:40:00 GMT 2006
Author: ab
Date: 2006-03-10 14:39:59 +0000 (Fri, 10 Mar 2006)
New Revision: 14159
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14159
Log:
Fix coverity CID #147 -- do not dereference pointers before checking their existence
Modified:
trunk/source/libsmb/libsmbclient.c
Changeset:
Modified: trunk/source/libsmb/libsmbclient.c
===================================================================
--- trunk/source/libsmb/libsmbclient.c 2006-03-10 14:39:29 UTC (rev 14158)
+++ trunk/source/libsmb/libsmbclient.c 2006-03-10 14:39:59 UTC (rev 14159)
@@ -1282,8 +1282,8 @@
pstring path, targetpath;
struct cli_state *targetcli;
- offset = file->offset; /* See "offset" comment in smbc_read_ctx() */
-
+ /* First check all pointers before dereferencing them */
+
if (!context || !context->internal ||
!context->internal->_initialized) {
@@ -1308,6 +1308,8 @@
}
+ offset = file->offset; /* See "offset" comment in smbc_read_ctx() */
+
/*d_printf(">>>write: parsing %s\n", file->fname);*/
if (smbc_parse_path(context, file->fname,
NULL, 0,
More information about the samba-cvs
mailing list