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
c8353f7a
Commit
c8353f7a
authored
Dec 15, 2014
by
Howard Chu
Browse files
ITS#8003 fix off-by-one in LDIF length
must account for leading space when counting total number of lines
parent
508f4158
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/ldif.h
View file @
c8353f7a
...
...
@@ -52,12 +52,12 @@ LDAP_LDIF_V (int) ldif_debug;
*/
#define LDIF_SIZE_NEEDED(nlen,vlen) \
((nlen) + 4 + LDIF_BASE64_LEN(vlen) \
+ ((LDIF_BASE64_LEN(vlen) + (nlen) + 3) / LDIF_LINE_WIDTH * 2 ))
+ ((LDIF_BASE64_LEN(vlen) + (nlen) + 3) /
(
LDIF_LINE_WIDTH
-1)
* 2 ))
#define LDIF_SIZE_NEEDED_WRAP(nlen,vlen,wrap) \
((nlen) + 4 + LDIF_BASE64_LEN(vlen) \
+ ((wrap) == 0 ? ((LDIF_BASE64_LEN(vlen) + (nlen) + 3) / ( LDIF_LINE_WIDTH ) * 2 ) : \
((wrap) == LDIF_LINE_WIDTH_MAX ? 0 : ((LDIF_BASE64_LEN(vlen) + (nlen) + 3) / (wrap) * 2 ))))
+ ((wrap) == 0 ? ((LDIF_BASE64_LEN(vlen) + (nlen) + 3) / ( LDIF_LINE_WIDTH
-1
) * 2 ) : \
((wrap) == LDIF_LINE_WIDTH_MAX ? 0 : ((LDIF_BASE64_LEN(vlen) + (nlen) + 3) / (wrap
-1
) * 2 ))))
LDAP_LDIF_F
(
int
)
ldif_parse_line
LDAP_P
((
...
...
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