summaryrefslogtreecommitdiff
path: root/source3/rpc_server/spoolss
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-01-18 18:04:17 +0100
committerDavid Disseldorp <ddiss@samba.org>2013-01-21 13:30:11 +0100
commitc38fb0b106b62e42a5b75b1c78386bb8912c7d7e (patch)
treea52e37e717c0f0fcb4e86397ae9ba014cabf5873 /source3/rpc_server/spoolss
parentf70d0ac7390fdd0f305f0ee1133fd9611ca3333a (diff)
downloadsamba-c38fb0b106b62e42a5b75b1c78386bb8912c7d7e.tar.gz
samba-c38fb0b106b62e42a5b75b1c78386bb8912c7d7e.tar.bz2
samba-c38fb0b106b62e42a5b75b1c78386bb8912c7d7e.zip
BUG 9574: Fix a possible null pointer dereference in spoolss.
If the the client enumerates the printers and didn't specify a servername we have a null pointer dereference, so the process serving the connection crashes. Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Mon Jan 21 13:30:11 CET 2013 on sn-devel-104
Diffstat (limited to 'source3/rpc_server/spoolss')
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index ef854b1c08..9df0b8ab32 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -4466,7 +4466,8 @@ static WERROR enum_all_printers_info_1_network(TALLOC_CTX *mem_ctx,
listed. Windows responds to this call with a
WERR_CAN_NOT_COMPLETE so we should do the same. */
- if (servername[0] == '\\' && servername[1] == '\\') {
+ if (servername != NULL &&
+ (servername[0] == '\\') && (servername[1] == '\\')) {
s = servername + 2;
}