summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/smb2_server.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index d1b7ac5ce1..0ffeb4818d 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -322,8 +322,13 @@ static bool smb2_validate_message_id(struct smbd_server_connection *sconn,
return false;
}
+ if (sconn->smb2.credits_granted == 0) {
+ smbd_server_connection_terminate(sconn, "smb2_validate_message_id: "
+ "terminating connection: client used more credits than granted\n");
+ return false;
+ }
+
/* client just used a credit. */
- SMB_ASSERT(sconn->smb2.credits_granted > 0);
sconn->smb2.credits_granted -= 1;
/* Mark the message_id as seen in the bitmap. */