Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
04af46b1
Commit
04af46b1
authored
Feb 26, 2015
by
Howard Chu
Browse files
ITS#8066 fix mdb_load with large values
parent
6fe12f32
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/mdb_load.c
View file @
04af46b1
...
...
@@ -176,7 +176,7 @@ static int unhex(unsigned char *c2)
static
int
readline
(
MDB_val
*
out
,
MDB_val
*
buf
)
{
unsigned
char
*
c1
,
*
c2
,
*
end
;
size_t
len
;
size_t
len
,
l2
;
int
c
;
if
(
!
(
mode
&
NOHDR
))
{
...
...
@@ -206,6 +206,7 @@ badend:
c1
=
buf
->
mv_data
;
len
=
strlen
((
char
*
)
c1
);
l2
=
len
;
/* Is buffer too short? */
while
(
c1
[
len
-
1
]
!=
'\n'
)
{
...
...
@@ -217,17 +218,18 @@ badend:
return
EOF
;
}
c1
=
buf
->
mv_data
;
c1
+=
buf
->
mv_size
;
if
(
fgets
((
char
*
)
c1
,
buf
->
mv_size
,
stdin
)
==
NULL
)
{
c1
+=
l2
;
if
(
fgets
((
char
*
)
c1
,
buf
->
mv_size
+
1
,
stdin
)
==
NULL
)
{
Eof
=
1
;
badend
();
return
EOF
;
}
buf
->
mv_size
*=
2
;
len
=
strlen
((
char
*
)
c1
);
l2
+=
len
;
}
c1
=
c2
=
buf
->
mv_data
;
len
=
strlen
((
char
*
)
c1
)
;
len
=
l2
;
c1
[
--
len
]
=
'\0'
;
end
=
c1
+
len
;
...
...
Write
Preview
Supports
Markdown
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