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
332d5921
Commit
332d5921
authored
Mar 08, 2017
by
Sebastian Lackner
Committed by
Alexandre Julliard
Mar 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Explicitly mark memory as undefined in mem_alloc wrapper.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
65e62c33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
object.c
server/object.c
+15
-1
No files found.
server/object.c
View file @
332d5921
...
...
@@ -28,6 +28,9 @@
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
#ifdef HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
...
...
@@ -92,11 +95,22 @@ void close_objects(void)
/*****************************************************************/
/* mark a block of memory as uninitialized for debugging purposes */
static
inline
void
mark_block_uninitialized
(
void
*
ptr
,
size_t
size
)
{
memset
(
ptr
,
0x55
,
size
);
#if defined(VALGRIND_MAKE_MEM_UNDEFINED)
VALGRIND_DISCARD
(
VALGRIND_MAKE_MEM_UNDEFINED
(
ptr
,
size
));
#elif defined(VALGRIND_MAKE_WRITABLE)
VALGRIND_DISCARD
(
VALGRIND_MAKE_WRITABLE
(
ptr
,
size
));
#endif
}
/* malloc replacement */
void
*
mem_alloc
(
size_t
size
)
{
void
*
ptr
=
malloc
(
size
);
if
(
ptr
)
m
emset
(
ptr
,
0x55
,
size
);
if
(
ptr
)
m
ark_block_uninitialized
(
ptr
,
size
);
else
set_error
(
STATUS_NO_MEMORY
);
return
ptr
;
}
...
...
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