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
fa066c74
Commit
fa066c74
authored
Oct 02, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Oct 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Fix behaviour of InternetTimeFromSystemTimeA/W when a buffer that is…
wininet: Fix behaviour of InternetTimeFromSystemTimeA/W when a buffer that is too small is passed in.
parent
ef0e3792
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
internet.c
dlls/wininet/internet.c
+12
-2
http.c
dlls/wininet/tests/http.c
+0
-3
No files found.
dlls/wininet/internet.c
View file @
fa066c74
...
...
@@ -2478,6 +2478,12 @@ BOOL WINAPI InternetTimeFromSystemTimeA( const SYSTEMTIME* time, DWORD format, L
TRACE
(
"%p 0x%08x %p 0x%08x
\n
"
,
time
,
format
,
string
,
size
);
if
(
size
<
INTERNET_RFC1123_BUFSIZE
*
sizeof
(
*
string
))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
ret
=
InternetTimeFromSystemTimeW
(
time
,
format
,
stringW
,
sizeof
(
stringW
)
);
if
(
ret
)
WideCharToMultiByte
(
CP_ACP
,
0
,
stringW
,
-
1
,
string
,
size
,
NULL
,
NULL
);
...
...
@@ -2495,10 +2501,14 @@ BOOL WINAPI InternetTimeFromSystemTimeW( const SYSTEMTIME* time, DWORD format, L
TRACE
(
"%p 0x%08x %p 0x%08x
\n
"
,
time
,
format
,
string
,
size
);
if
(
!
time
||
!
string
)
return
FALSE
;
if
(
!
time
||
!
string
||
format
!=
INTERNET_RFC1123_FORMAT
)
return
FALSE
;
if
(
format
!=
INTERNET_RFC1123_FORMAT
||
size
<
INTERNET_RFC1123_BUFSIZE
*
sizeof
(
WCHAR
))
if
(
size
<
INTERNET_RFC1123_BUFSIZE
*
sizeof
(
*
string
))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
sprintfW
(
string
,
date
,
WININET_wkday
[
time
->
wDayOfWeek
],
...
...
dlls/wininet/tests/http.c
View file @
fa066c74
...
...
@@ -800,12 +800,10 @@ static void InternetTimeFromSystemTimeA_test(void)
SetLastError
(
0xdeadbeef
);
ret
=
pInternetTimeFromSystemTimeA
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
0
);
error
=
GetLastError
();
todo_wine
{
ok
(
!
ret
,
"InternetTimeFromSystemTimeA should have returned FALSE
\n
"
);
ok
(
error
==
ERROR_INSUFFICIENT_BUFFER
,
"InternetTimeFromSystemTimeA failed with ERROR_INSUFFICIENT_BUFFER instead of %u
\n
"
,
error
);
}
}
static
void
InternetTimeFromSystemTimeW_test
(
void
)
...
...
@@ -827,7 +825,6 @@ static void InternetTimeFromSystemTimeW_test(void)
ret
=
pInternetTimeFromSystemTimeW
(
&
time
,
INTERNET_RFC1123_FORMAT
,
string
,
sizeof
(
string
)
/
sizeof
(
string
[
0
])
);
error
=
GetLastError
();
ok
(
!
ret
,
"InternetTimeFromSystemTimeW should have returned FALSE
\n
"
);
todo_wine
ok
(
error
==
ERROR_INSUFFICIENT_BUFFER
,
"InternetTimeFromSystemTimeW failed with ERROR_INSUFFICIENT_BUFFER instead of %u
\n
"
,
error
);
...
...
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