Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c1dce86f
Commit
c1dce86f
authored
Apr 26, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
May 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Fix peeking of http data with a nul byte in it.
parent
4a7bb647
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
internet.h
dlls/wininet/internet.h
+1
-0
netconnection.c
dlls/wininet/netconnection.c
+10
-11
No files found.
dlls/wininet/internet.h
View file @
c1dce86f
...
...
@@ -63,6 +63,7 @@ typedef struct
SSL
*
ssl_s
;
char
*
peek_msg
;
char
*
peek_msg_mem
;
size_t
peek_len
;
#endif
}
WININET_NETCONNECTION
;
...
...
dlls/wininet/netconnection.c
View file @
c1dce86f
...
...
@@ -305,6 +305,7 @@ BOOL NETCON_close(WININET_NETCONNECTION *connection)
HeapFree
(
GetProcessHeap
(),
0
,
connection
->
peek_msg_mem
);
connection
->
peek_msg
=
NULL
;
connection
->
peek_msg_mem
=
NULL
;
connection
->
peek_len
=
0
;
pSSL_shutdown
(
connection
->
ssl_s
);
pSSL_free
(
connection
->
ssl_s
);
...
...
@@ -520,19 +521,19 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f
}
else
if
(
flags
&
MSG_PEEK
&&
connection
->
peek_msg
)
{
size_t
peek_msg_len
=
strlen
(
connection
->
peek_msg
);
if
(
len
<
peek_msg_len
)
if
(
len
<
connection
->
peek_len
)
FIXME
(
"buffer isn't big enough. Do the expect us to wrap?
\n
"
);
memcpy
(
buf
,
connection
->
peek_msg
,
min
(
len
,
peek_msg_len
+
1
)
);
*
recvd
=
min
(
len
,
peek_msg_len
);
*
recvd
=
min
(
len
,
connection
->
peek_len
);
memcpy
(
buf
,
connection
->
peek_msg
,
*
recvd
);
return
TRUE
;
}
else
if
(
connection
->
peek_msg
)
{
size_t
peek_msg_len
=
strlen
(
connection
->
peek_msg
);
memcpy
(
buf
,
connection
->
peek_msg
,
min
(
len
,
peek_msg_len
+
1
));
connection
->
peek_msg
+=
*
recvd
=
min
(
len
,
peek_msg_len
);
if
(
*
connection
->
peek_msg
==
'\0'
||
*
(
connection
->
peek_msg
-
1
)
==
'\0'
)
*
recvd
=
min
(
len
,
connection
->
peek_len
);
memcpy
(
buf
,
connection
->
peek_msg
,
*
recvd
);
connection
->
peek_len
-=
*
recvd
;
connection
->
peek_msg
+=
*
recvd
;
if
(
connection
->
peek_len
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
connection
->
peek_msg_mem
);
connection
->
peek_msg_mem
=
NULL
;
...
...
@@ -543,6 +544,7 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f
*
recvd
=
pSSL_read
(
connection
->
ssl_s
,
buf
,
len
);
if
(
flags
&
MSG_PEEK
)
/* must copy stuff into buffer */
{
connection
->
peek_len
=
*
recvd
;
if
(
!*
recvd
)
{
HeapFree
(
GetProcessHeap
(),
0
,
connection
->
peek_msg_mem
);
...
...
@@ -550,10 +552,7 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f
connection
->
peek_msg
=
NULL
;
}
else
{
memcpy
(
connection
->
peek_msg
,
buf
,
*
recvd
);
connection
->
peek_msg
[
*
recvd
]
=
'\0'
;
}
}
if
(
*
recvd
<
1
&&
len
)
return
FALSE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment