summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-11-17 21:22:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:19 -0500
commit0c639097cf033b25c956222c72622e6b97695f59 (patch)
treed44ad9e325793d6696f0bede7f3d7e754e3836a2
parent00f6baa15ae29e04f8d298dd5bbb81719cc912a7 (diff)
downloadsamba-0c639097cf033b25c956222c72622e6b97695f59.tar.gz
samba-0c639097cf033b25c956222c72622e6b97695f59.tar.bz2
samba-0c639097cf033b25c956222c72622e6b97695f59.zip
r3824: Fix crash in api_RNetShareEnum. ServicePtrs[] may contain invalid
entries. Happened after rev3708 removed non-existing cups printers. Volker (This used to be commit 60998d9d2f6272e383304da2b1d568a4b65f8787)
-rw-r--r--source3/smbd/lanman.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 1379877efc..aeea9de9ca 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -1502,6 +1502,8 @@ static BOOL api_RNetShareEnum( connection_struct *conn,
data_len = fixed_len = string_len = 0;
for (i=0;i<count;i++) {
fstring servicename_dos;
+ if (!(lp_browseable(i) && lp_snum_ok(i)))
+ continue;
push_ascii_fstring(servicename_dos, lp_servicename(i));
if( lp_browseable( i )
&& lp_snum_ok( i )
@@ -1530,6 +1532,8 @@ static BOOL api_RNetShareEnum( connection_struct *conn,
for( i = 0; i < count; i++ )
{
fstring servicename_dos;
+ if (!(lp_browseable(i) && lp_snum_ok(i)))
+ continue;
push_ascii_fstring(servicename_dos, lp_servicename(i));
if( lp_browseable( i )
&& lp_snum_ok( i )