spoolss: clear FormInfo on GetForm error
authorDavid Disseldorp <ddiss@samba.org>
Wed, 17 Dec 2014 14:29:52 +0000 (15:29 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 19 Dec 2014 14:40:43 +0000 (15:40 +0100)
In handling a spoolss GetForm request, the handler may return an
immediate error if one of the input parameters is invalid.  If this is
done without zeroing the pre-allocated @info pointer, then marshalling
of the response will fail.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10984

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/rpc_server/spoolss/srv_spoolss_nt.c

index 9023ab672ff2ad8d3505705e49ac29b60adf34ff..9b898d0ab539a3aafe0481b91e7756c9bd25e3be 100644 (file)
@@ -7853,6 +7853,7 @@ WERROR _spoolss_GetForm(struct pipes_struct *p,
        /* that's an [in out] buffer */
 
        if (!r->in.buffer && (r->in.offered != 0)) {
+               TALLOC_FREE(r->out.info);
                return WERR_INVALID_PARAM;
        }