mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-23 15:07:03 +01:00
fixed silly allocation bug
This commit is contained in:
parent
a255ea76ae
commit
57c1dbc21d
@ -1,5 +1,8 @@
|
|||||||
2001-08-09 Werner Koch <wk@gnupg.org>
|
2001-08-09 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* build-packet.c (build_sig_subpkt): Fixed calculation of
|
||||||
|
newarea->size.
|
||||||
|
|
||||||
* g10.c (main): New option "--preference-list"
|
* g10.c (main): New option "--preference-list"
|
||||||
* keyedit.c (keyedit_menu): New commands "setpref" and "updpref".
|
* keyedit.c (keyedit_menu): New commands "setpref" and "updpref".
|
||||||
(menu_set_preferences): New.
|
(menu_set_preferences): New.
|
||||||
|
@ -800,11 +800,12 @@ build_sig_subpkt (PKT_signature *sig, sigsubpkttype_t type,
|
|||||||
}
|
}
|
||||||
else if (oldarea) {
|
else if (oldarea) {
|
||||||
newarea = m_realloc (oldarea, sizeof (*newarea) + n - 1);
|
newarea = m_realloc (oldarea, sizeof (*newarea) + n - 1);
|
||||||
newarea->size = sizeof (*newarea) + n - 1;
|
newarea->size = n;
|
||||||
/*log_debug ("reallocating area for type %d\n", type );*/
|
/*log_debug ("reallocating area for type %d\n", type );*/
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
newarea = m_alloc (sizeof (*newarea) + n - 1);
|
newarea = m_alloc (sizeof (*newarea) + n - 1);
|
||||||
|
newarea->size = n;
|
||||||
/*log_debug ("allocating area for type %d\n", type );*/
|
/*log_debug ("allocating area for type %d\n", type );*/
|
||||||
}
|
}
|
||||||
newarea->len = n;
|
newarea->len = n;
|
||||||
|
@ -1139,7 +1139,7 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
if( n ) {
|
if( n ) {
|
||||||
/* we add 6 extra bytes so that we have space for the signature
|
/* we add 8 extra bytes so that we have space for the signature
|
||||||
* status cache. Well we are wastin this if there is a cache
|
* status cache. Well we are wastin this if there is a cache
|
||||||
* packet already, but in the other case it avoids an realloc */
|
* packet already, but in the other case it avoids an realloc */
|
||||||
sig->unhashed = m_alloc (sizeof(*sig->unhashed) + n + 8 - 1 );
|
sig->unhashed = m_alloc (sizeof(*sig->unhashed) + n + 8 - 1 );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user