]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
spoolss: clear FormInfo on GetForm error
authorDavid Disseldorp <ddiss@samba.org>
Wed, 17 Dec 2014 14:29:52 +0000 (15:29 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 14 Jan 2015 20:58:09 +0000 (21:58 +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>
(cherry picked from commit b113ed6043622cdec68f3a70631b363594f3a8d0)

source3/rpc_server/spoolss/srv_spoolss_nt.c

index d29d8543041a7012e68274105e6a8ea31ad81203..cc5e652c7211bc4ba487b8fbcf8e9dadee35bfe1 100644 (file)
@@ -7848,6 +7848,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;
        }