mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 07:25:36 -04:00
fixed bug in deferred signature code, due to thread copy+write mechanism
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6271 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1c27366cfa
commit
3a8c9ad496
1 changed files with 5 additions and 2 deletions
|
@ -151,7 +151,6 @@ class SignatureEventData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SignatureEventData(const void *_data,int32_t _len,unsigned int _signlen)
|
SignatureEventData(const void *_data,int32_t _len,unsigned int _signlen)
|
||||||
: data(_data),len(_len)
|
|
||||||
{
|
{
|
||||||
// We need a new memory chnk because there's no guarranty _sign nor _signlen are not in the stack
|
// We need a new memory chnk because there's no guarranty _sign nor _signlen are not in the stack
|
||||||
|
|
||||||
|
@ -159,12 +158,16 @@ class SignatureEventData
|
||||||
signlen = new unsigned int ;
|
signlen = new unsigned int ;
|
||||||
*signlen = _signlen ;
|
*signlen = _signlen ;
|
||||||
signature_result = 0 ;
|
signature_result = 0 ;
|
||||||
|
data = malloc(_len) ;
|
||||||
|
len = _len ;
|
||||||
|
memcpy(data,_data,len) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
~SignatureEventData()
|
~SignatureEventData()
|
||||||
{
|
{
|
||||||
free(sign) ;
|
free(sign) ;
|
||||||
delete signlen ;
|
delete signlen ;
|
||||||
|
free(data) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool performSignature()
|
bool performSignature()
|
||||||
|
@ -173,7 +176,7 @@ class SignatureEventData
|
||||||
signature_result = 1 ;
|
signature_result = 1 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *data ;
|
void *data ;
|
||||||
uint32_t len ;
|
uint32_t len ;
|
||||||
unsigned char *sign ;
|
unsigned char *sign ;
|
||||||
unsigned int *signlen ;
|
unsigned int *signlen ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue