Fix trimming of non-escaped trailing space in ldif_parse_attribute().
Found by PVS-Studio.
This commit is contained in:
@@ -117,10 +117,11 @@ ldif_parse_attribute(char *str)
|
|||||||
|
|
||||||
ep = str + strlen(str);
|
ep = str + strlen(str);
|
||||||
while (ep > str && ep[-1] == ' ') {
|
while (ep > str && ep[-1] == ' ') {
|
||||||
/* Don't trim ecaped trailing space if not base64. */
|
ep--;
|
||||||
if (!encoded && ep != str && ep[-2] == '\\')
|
/* Don't trim escaped trailing space if not base64. */
|
||||||
|
if (!encoded && ep != str && ep[-1] == '\\')
|
||||||
break;
|
break;
|
||||||
*--ep = '\0';
|
*ep = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
attr = str;
|
attr = str;
|
||||||
|
Reference in New Issue
Block a user