summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-07-23 19:46:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:28:56 -0500
commit8e2aa47b3fb159ce17ea9cd7f8d88a59386c0d84 (patch)
treee2af36b314a24a0d7945bc025707384fd980b9d2 /source3/smbd
parent40485cc81f4f87f2fd642655369abc9cd9cbd9d3 (diff)
downloadsamba-8e2aa47b3fb159ce17ea9cd7f8d88a59386c0d84.tar.gz
samba-8e2aa47b3fb159ce17ea9cd7f8d88a59386c0d84.tar.bz2
samba-8e2aa47b3fb159ce17ea9cd7f8d88a59386c0d84.zip
r24009: Revert to the 3.0.25 logic for parsing the client's protocols. hpisgr8
with gcc still gives timeouts which worry me. Volker (This used to be commit c30835b4f0416b2b2b7d77d31b0fca0606f2387a)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/negprot.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 7602490c2d..a8578d56b5 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -511,6 +511,7 @@ void reply_negprot(connection_struct *conn, struct smb_request *req)
int choice= -1;
int protocol;
char *p;
+ int bcc = SVAL(smb_buf(req->inbuf),-2);
int arch = ARCH_ALL;
int num_cliprotos;
char **cliprotos;
@@ -533,23 +534,14 @@ void reply_negprot(connection_struct *conn, struct smb_request *req)
return;
}
- p = smb_buf(req->inbuf);
+ p = smb_buf(req->inbuf) + 1;
num_cliprotos = 0;
cliprotos = NULL;
- while (smb_bufrem(req->inbuf, p) > 0) {
- char **tmp;
-
- if (p[0] != 0x02) {
- DEBUG(3, ("Invalid string specifier %x, expected "
- "0x02\n", (int)p[0]));
- reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
- END_PROFILE(SMBnegprot);
- return;
- }
+ while (p < (smb_buf(req->inbuf) + bcc)) {
- p += 1; /* Skip the "0x02" */
+ char **tmp;
tmp = TALLOC_REALLOC_ARRAY(tmp_talloc_ctx(), cliprotos, char *,
num_cliprotos+1);
@@ -576,7 +568,7 @@ void reply_negprot(connection_struct *conn, struct smb_request *req)
cliprotos[num_cliprotos]));
num_cliprotos += 1;
- p += strlen(p) + 1;
+ p += strlen(p) + 2;
}
for (i=0; i<num_cliprotos; i++) {