r23902: Fix uninitialized read in devicetype noticed by Volker.
authorJeremy Allison <jra@samba.org>
Mon, 16 Jul 2007 18:17:19 +0000 (18:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:28:39 +0000 (12:28 -0500)
Jeremy

source/smbd/reply.c

index 8b6a164a6656a8a55bc89d48e813ff7c6bf6abac..2421e2ffd98d59e43786e2a26caefe2c28d69fb7 100644 (file)
@@ -529,7 +529,7 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
        }
 
        p += srvstr_pull_talloc(ctx, inbuf, SVAL(inbuf, smb_flg2), &client_devicetype, p,
-                        6, STR_ASCII);
+                        MIN(6,smb_bufrem(inbuf, p)), STR_ASCII);
 
        if (client_devicetype == NULL) {
                TALLOC_FREE(ctx);