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
openldap
OpenLDAP
Commits
65e163d2
Commit
65e163d2
authored
Jun 20, 2011
by
Jan Vcelak
Committed by
Howard Chu
Jun 20, 2011
Browse files
ITS
#6947
Handle missing '\n' termination in LDIF input
parent
6f436007
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/libldap/ldif.c
View file @
65e163d2
...
...
@@ -842,11 +842,16 @@ ldif_read_record(
if
(
fgets
(
line
,
sizeof
(
line
),
lfp
->
fp
)
==
NULL
)
{
stop
=
1
;
/* Add \n in case the file does not end with newline */
line
[
0
]
=
'\n'
;
line
[
1
]
=
'\0'
;
len
=
0
;
}
else
{
len
=
strlen
(
line
);
}
if
(
len
==
0
||
line
[
len
-
1
]
!=
'\n'
)
{
/* Add \n in case the line/file does not end with newline */
line
[
len
]
=
'\n'
;
line
[
++
len
]
=
'\0'
;
}
len
=
strlen
(
line
);
if
(
last_ch
==
'\n'
)
{
(
*
lno
)
++
;
...
...
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