Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
orbea -
OpenLDAP
Commits
a55d3331
Commit
a55d3331
authored
14 years ago
by
Hallvard Furuseth
Browse files
Options
Downloads
Patches
Plain Diff
ITS
#6733
: Fix LDAP_MEMORY_DEBUG issues.
ber_memcalloc_x overflow check. Silence some compiler warnings.
parent
6be36719
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/liblber/memory.c
+5
-3
5 additions, 3 deletions
libraries/liblber/memory.c
with
5 additions
and
3 deletions
libraries/liblber/memory.c
+
5
−
3
View file @
a55d3331
...
...
@@ -62,9 +62,9 @@ struct ber_mem_hdr {
};
/* Pattern at top of allocated space */
#define LBER_MEM_JUNK 0xdeaddada
U
#define LBER_MEM_JUNK
((ber_int_t)
0xdeaddada
)
static
const
struct
ber_mem_hdr
ber_int_mem_hdr
=
{
LBER_MEM_JUNK
,
0
,
0
};
static
const
struct
ber_mem_hdr
ber_int_mem_hdr
=
{
LBER_MEM_JUNK
};
/* Note sequence and ber_int_meminuse are counters, but are not
* thread safe. If you want to use these values for multithreaded applications,
...
...
@@ -256,7 +256,9 @@ ber_memcalloc_x( ber_len_t n, ber_len_t s, void *ctx )
if
(
ber_int_memory_fns
==
NULL
||
ctx
==
NULL
)
{
#ifdef LDAP_MEMORY_DEBUG
new
=
calloc
(
1
,
n
*
s
+
sizeof
(
struct
ber_mem_hdr
)
+
sizeof
(
ber_int_t
));
new
=
n
<
(
-
sizeof
(
struct
ber_mem_hdr
)
-
sizeof
(
ber_int_t
))
/
s
?
calloc
(
1
,
n
*
s
+
sizeof
(
struct
ber_mem_hdr
)
+
sizeof
(
ber_int_t
))
:
NULL
;
if
(
new
)
{
struct
ber_mem_hdr
*
mh
=
new
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment