s3-samr: fix _QueryDisplayInformation r->out.returned_size.
authorGünther Deschner <gd@samba.org>
Sat, 6 Jun 2009 22:47:03 +0000 (00:47 +0200)
committerGünther Deschner <gd@samba.org>
Sat, 6 Jun 2009 22:56:04 +0000 (00:56 +0200)
*r->out.returned_size needs to be 0 if nothing was enumerated.

Found by RPC-SAMR torture test.

Guenther

source3/rpc_server/srv_samr_nt.c

index 6e990a319fb4055dfabd0134fd2012deb8ff904d..e2f65ae322fc6ed14e3881cd362218973b3dbeac 100644 (file)
@@ -1603,7 +1603,7 @@ NTSTATUS _samr_QueryDisplayInfo(pipes_struct *p,
        DEBUG(5, ("_samr_QueryDisplayInfo: %d\n", __LINE__));
 
        *r->out.total_size = num_account * struct_size;
-       *r->out.returned_size = temp_size;
+       *r->out.returned_size = num_account ? temp_size : 0;
 
        return status;
 }