summaryrefslogtreecommitdiffstats
path: root/source3/client/smbspool.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-28 04:30:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:03 -0500
commitc1dbb16945d82bd1a41ff64811b727bdbef6a26f (patch)
treeef47b79fc1ea065e2203cea83b17fb6957735c15 /source3/client/smbspool.c
parent95a81a33513517c25476286453c89ab1884e9919 (diff)
downloadsamba-c1dbb16945d82bd1a41ff64811b727bdbef6a26f.tar.gz
samba-c1dbb16945d82bd1a41ff64811b727bdbef6a26f.tar.xz
samba-c1dbb16945d82bd1a41ff64811b727bdbef6a26f.zip
r16608: Klocwork #2035. Null deref (bit of a stretch... :-).
Jeremy. (This used to be commit 7d7a98208b1b514da60486fcbbb7b6d04df4ffac)
Diffstat (limited to 'source3/client/smbspool.c')
-rw-r--r--source3/client/smbspool.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index e5cd4f2e8e..c9a7fbe10e 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -72,6 +72,7 @@ static int smb_print(struct cli_state *, char *, FILE *);
struct cli_state *cli; /* SMB interface */
char null_str[1];
int tries = 0;
+ const char *dev_uri;
null_str[0] = '\0';
@@ -132,8 +133,9 @@ static int smb_print(struct cli_state *, char *, FILE *);
* Find the URI...
*/
- if (getenv("DEVICE_URI") != NULL)
- strncpy(uri, getenv("DEVICE_URI"), sizeof(uri) - 1);
+ dev_uri = getenv("DEVICE_URI");
+ if (dev_uri)
+ strncpy(uri, dev_uri, sizeof(uri) - 1);
else if (strncmp(argv[0], "smb://", 6) == 0)
strncpy(uri, argv[0], sizeof(uri) - 1);
else