Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
82f77cc1
Commit
82f77cc1
authored
Sep 30, 2008
by
Jeff Zaroyko
Committed by
Alexandre Julliard
Oct 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Avoid a NULL pointer deref in ctime.
parent
b77f0a16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
time.c
dlls/msvcrt/tests/time.c
+8
-0
time.c
dlls/msvcrt/time.c
+4
-1
No files found.
dlls/msvcrt/tests/time.c
View file @
82f77cc1
...
...
@@ -31,6 +31,13 @@
#define MINSPERHOUR 60
#define HOURSPERDAY 24
static
void
test_ctime
(
void
)
{
time_t
badtime
=
-
1
;
char
*
ret
;
ret
=
ctime
(
&
badtime
);
ok
(
ret
==
NULL
,
"expected ctime to return NULL, got %s
\n
"
,
ret
);
}
static
void
test_gmtime
(
void
)
{
time_t
gmt
=
(
time_t
)
NULL
;
...
...
@@ -249,6 +256,7 @@ static void test_wstrtime(void)
START_TEST
(
time
)
{
test_ctime
();
test_gmtime
();
test_mktime
();
test_localtime
();
...
...
dlls/msvcrt/time.c
View file @
82f77cc1
...
...
@@ -447,7 +447,10 @@ MSVCRT_wchar_t * CDECL MSVCRT__wasctime(const struct MSVCRT_tm *mstm)
*/
char
*
CDECL
MSVCRT_ctime
(
const
MSVCRT_time_t
*
time
)
{
return
MSVCRT_asctime
(
MSVCRT_localtime
(
time
)
);
struct
MSVCRT_tm
*
t
;
t
=
MSVCRT_localtime
(
time
);
if
(
!
t
)
return
NULL
;
return
MSVCRT_asctime
(
t
);
}
/*********************************************************************
...
...
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