Skip to content

Commit

Permalink
s4-kdc: Do not leak memory on error in kpasswd_make_error_reply()
Browse files Browse the repository at this point in the history
CID 1372874

Signed-off-by: Andreas Schneider <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>

Autobuild-User(master): Jeremy Allison <[email protected]>
Autobuild-Date(master): Tue Sep 13 22:13:31 CEST 2016 on sn-devel-144
  • Loading branch information
cryptomilk authored and jrasamba committed Sep 13, 2016
1 parent 7a0ff3b commit 8267ec2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source4/kdc/kpasswd-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ bool kpasswd_make_error_reply(TALLOC_CTX *mem_ctx,
*/
#ifndef SAMBA4_USES_HEIMDAL
if (slen < 2) {
talloc_free(s);
return false;
}
slen -= 2;
#endif
if (2 + slen < slen) {
talloc_free(s);
return false;
}
error_data->length = 2 + slen;
Expand Down

0 comments on commit 8267ec2

Please sign in to comment.