mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-26 07:55:44 -04:00
fixed potential use after free in openpgpsdk
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8491 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4b624a6091
commit
779ebbf925
1 changed files with 6 additions and 2 deletions
|
@ -1116,11 +1116,15 @@ ops_boolean_t ops_sign_file_as_cleartext(const char* input_filename,
|
||||||
&& ops_signature_hashed_subpackets_end(sig)
|
&& ops_signature_hashed_subpackets_end(sig)
|
||||||
&& ops_write_signature(sig, &skey->public_key, skey, cinfo);
|
&& ops_write_signature(sig, &skey->public_key, skey, cinfo);
|
||||||
|
|
||||||
ops_teardown_file_write(cinfo, fd_out);
|
|
||||||
|
|
||||||
if (!rtn)
|
if (!rtn)
|
||||||
OPS_ERROR(&cinfo->errors, OPS_E_W, "Cannot sign file as cleartext");
|
OPS_ERROR(&cinfo->errors, OPS_E_W, "Cannot sign file as cleartext");
|
||||||
|
|
||||||
|
// we can't get errors in cinfo->errors while closing
|
||||||
|
// because ops_teardown_file_write frees everything
|
||||||
|
// it seems that writer finalisers do not report errors anyway
|
||||||
|
// and ops_teardown_file_write does not have an return value, so we could not bubble something up
|
||||||
|
ops_teardown_file_write(cinfo, fd_out);
|
||||||
|
|
||||||
return rtn;
|
return rtn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue