sudo-project / sudo

Utility to execute a command as another user
https://www.sudo.ws
Other
1.2k stars 224 forks source link

Write to dst only if sudo_ldap_value_cat succeeds #288

Closed AreaZR closed 1 year ago

AreaZR commented 1 year ago

There's no point in writing to memory if it has to be freed anyway.

millert commented 1 year ago

sudo_ldap_value_cat() requires that the string being passed in be NUL-terminated so the:

*dst = '\0';

must happen first.