aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2001-08-09 15:49:28 +0000
committerWerner Koch <[email protected]>2001-08-09 15:49:28 +0000
commit57c1dbc21d402a591585d07bef527c6abcd07c9a (patch)
tree1454328c200557fbe735340b1b121c114c5218c6
parentAdded a way to update preferences (diff)
downloadgnupg-57c1dbc21d402a591585d07bef527c6abcd07c9a.tar.gz
gnupg-57c1dbc21d402a591585d07bef527c6abcd07c9a.zip
fixed silly allocation bug
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/build-packet.c3
-rw-r--r--g10/parse-packet.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 5325767db..05a3a42e5 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,5 +1,8 @@
2001-08-09 Werner Koch <[email protected]>
+ * build-packet.c (build_sig_subpkt): Fixed calculation of
+ newarea->size.
+
* g10.c (main): New option "--preference-list"
* keyedit.c (keyedit_menu): New commands "setpref" and "updpref".
(menu_set_preferences): New.
@@ -11,7 +14,7 @@
(keygen_add_std_prefs): Move the pref setting code into the above fnc.
* build-packet.c (build_sig_subpkt): Updated the list of allowed
to update subpackets.
-
+
2001-08-08 Werner Koch <[email protected]>
* packet.h (subpktarea_t): New.
diff --git a/g10/build-packet.c b/g10/build-packet.c
index 1235a451e..e39756dac 100644
--- a/g10/build-packet.c
+++ b/g10/build-packet.c
@@ -800,11 +800,12 @@ build_sig_subpkt (PKT_signature *sig, sigsubpkttype_t type,
}
else if (oldarea) {
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 );*/
}
else {
newarea = m_alloc (sizeof (*newarea) + n - 1);
+ newarea->size = n;
/*log_debug ("allocating area for type %d\n", type );*/
}
newarea->len = n;
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index f2f35afc2..0c3ab6188 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -1139,7 +1139,7 @@ parse_signature( IOBUF inp, int pkttype, unsigned long pktlen,
goto leave;
}
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
* packet already, but in the other case it avoids an realloc */
sig->unhashed = m_alloc (sizeof(*sig->unhashed) + n + 8 - 1 );