summaryrefslogtreecommitdiff
path: root/lib/decoding.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-05-17 08:08:15 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-05-17 08:08:15 +0200
commit07a5adb87880f3fce80aa12121409bbf652f1b6d (patch)
tree8b8f7a43948a7555a7aac8c35a2aade727b492aa /lib/decoding.c
parent3d6a02f19ff15a38dae9686033e37499b3968256 (diff)
downloadlibtasn1-07a5adb87880f3fce80aa12121409bbf652f1b6d.tar.gz
libtasn1-07a5adb87880f3fce80aa12121409bbf652f1b6d.tar.bz2
libtasn1-07a5adb87880f3fce80aa12121409bbf652f1b6d.zip
made _asn1_ltostr() safer.
Diffstat (limited to 'lib/decoding.c')
-rw-r--r--lib/decoding.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/decoding.c b/lib/decoding.c
index 7c6c9af..3f5e909 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -320,9 +320,9 @@ _asn1_get_objectid_der (const unsigned char *der, int der_len, int *ret_len,
val1 = der[len_len] / 40;
val = der[len_len] - val1 * 40;
- _asn1_str_cpy (str, str_size, _asn1_ltostr (val1, temp));
+ _asn1_str_cpy (str, str_size, _asn1_ltostr (val1, temp, sizeof(temp)));
_asn1_str_cat (str, str_size, ".");
- _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp));
+ _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp, sizeof(temp)));
val = 0;
leading = 1;
@@ -344,7 +344,7 @@ _asn1_get_objectid_der (const unsigned char *der, int der_len, int *ret_len,
if (!(der[len_len + k] & 0x80))
{
_asn1_str_cat (str, str_size, ".");
- _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp));
+ _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp, sizeof(temp)));
val = 0;
leading = 1;
}
@@ -1251,7 +1251,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int ider_len,
if (len3 > 0)
{
- _asn1_ltostr (counter + len3, temp);
+ _asn1_ltostr (counter + len3, temp, sizeof(temp));
tlen = strlen (temp);
if (tlen > 0)
_asn1_set_value (p, temp, tlen + 1);
@@ -1339,7 +1339,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int ider_len,
{
if (len3 > 0)
{ /* definite length method */
- _asn1_ltostr (counter + len3, temp);
+ _asn1_ltostr (counter + len3, temp, sizeof(temp));
tlen = strlen (temp);
if (tlen > 0)