Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
efda07f8
Commit
efda07f8
authored
Jul 14, 2009
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix null ptr deref on TDB_TRACE with internal db.
parent
310a8c6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
ccan/tdb/open.c
ccan/tdb/open.c
+11
-9
No files found.
ccan/tdb/open.c
View file @
efda07f8
...
...
@@ -153,9 +153,6 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
unsigned
char
*
vp
;
uint32_t
vertest
;
unsigned
v
;
#ifdef TDB_TRACE
char
tracefile
[
strlen
(
name
)
+
32
];
#endif
if
(
!
(
tdb
=
(
struct
tdb_context
*
)
calloc
(
1
,
sizeof
*
tdb
)))
{
/* Can't log this */
...
...
@@ -322,12 +319,17 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
}
#ifdef TDB_TRACE
sprintf
(
tracefile
,
"%s.trace.%u"
,
name
,
getpid
());
tdb
->
tracefd
=
open
(
tracefile
,
O_WRONLY
|
O_CREAT
|
O_EXCL
,
0600
);
if
(
tdb
->
tracefd
<
0
)
goto
fail
;
tdb_enable_seqnum
(
tdb
);
tdb_trace_open
(
tdb
,
"tdb_open"
,
hash_size
,
tdb_flags
,
open_flags
);
{
char
tracefile
[
strlen
(
name
)
+
32
];
sprintf
(
tracefile
,
"%s.trace.%u"
,
name
,
getpid
());
tdb
->
tracefd
=
open
(
tracefile
,
O_WRONLY
|
O_CREAT
|
O_EXCL
,
0600
);
if
(
tdb
->
tracefd
<
0
)
goto
fail
;
tdb_enable_seqnum
(
tdb
);
tdb_trace_open
(
tdb
,
"tdb_open"
,
hash_size
,
tdb_flags
,
open_flags
);
}
#endif
internal:
...
...
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