libtasn1-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU libtasn1 branch, master, updated. libtasn1_3_4-16-g40ebbd2


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_4-16-g40ebbd2
Date: Thu, 17 Apr 2014 13:41:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU libtasn1".

http://git.savannah.gnu.org/cgit/libtasn1.git/commit/?id=40ebbd29daa6ad73f944ce045c415d02b76eaedb

The branch, master has been updated
       via  40ebbd29daa6ad73f944ce045c415d02b76eaedb (commit)
      from  3239b9c45384005ef55edcce541261096669e686 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 40ebbd29daa6ad73f944ce045c415d02b76eaedb
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Apr 17 15:36:11 2014 +0200

    simplified asn1_find_structure_from_oid() and asn1_expand_any_defined_by().

-----------------------------------------------------------------------

Summary of changes:
 lib/decoding.c  |   12 +++++-------
 lib/structure.c |   10 ++++------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/lib/decoding.c b/lib/decoding.c
index e9af339..b6c9f1d 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -2509,18 +2509,18 @@ asn1_der_decoding_startEnd (asn1_node element, const 
void *ider, int len,
 int
 asn1_expand_any_defined_by (asn1_node definitions, asn1_node * element)
 {
-  char definitionsName[ASN1_MAX_NAME_SIZE], name[2 * ASN1_MAX_NAME_SIZE + 1],
+  char name[2 * ASN1_MAX_NAME_SIZE + 1],
     value[ASN1_MAX_NAME_SIZE];
   int retCode = ASN1_SUCCESS, result;
   int len, len2, len3;
   asn1_node p, p2, p3, aux = NULL;
   char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
+  const char *definitionsName;
 
   if ((definitions == NULL) || (*element == NULL))
     return ASN1_ELEMENT_NOT_FOUND;
 
-  strcpy (definitionsName, definitions->name);
-  strcat (definitionsName, ".");
+  definitionsName = definitions->name;
 
   p = *element;
   while (p)
@@ -2595,8 +2595,7 @@ asn1_expand_any_defined_by (asn1_node definitions, 
asn1_node * element)
                  if ((type_field (p2->type) == ASN1_ETYPE_OBJECT_ID) &&
                      (p2->type & CONST_ASSIGN))
                    {
-                     strcpy (name, definitionsName);
-                     strcat (name, p2->name);
+                     snprintf(name, sizeof(name), "%s.%s", definitionsName, 
p2->name);
 
                      len = ASN1_MAX_NAME_SIZE;
                      result =
@@ -2612,8 +2611,7 @@ asn1_expand_any_defined_by (asn1_node definitions, 
asn1_node * element)
 
                          if (p2)
                            {
-                             strcpy (name, definitionsName);
-                             strcat (name, p2->name);
+                             snprintf(name, sizeof(name), "%s.%s", 
definitionsName, p2->name);
 
                              result =
                                asn1_create_element (definitions, name, &aux);
diff --git a/lib/structure.c b/lib/structure.c
index 611ed94..d7df904 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -1087,18 +1087,17 @@ asn1_number_of_elements (asn1_node element, const char 
*name, int *num)
 const char *
 asn1_find_structure_from_oid (asn1_node definitions, const char *oidValue)
 {
-  char definitionsName[ASN1_MAX_NAME_SIZE], name[2 * ASN1_MAX_NAME_SIZE + 1];
+  char name[2 * ASN1_MAX_NAME_SIZE + 1];
   char value[ASN1_MAX_NAME_SIZE];
   asn1_node p;
   int len;
   int result;
+  const char *definitionsName;
 
   if ((definitions == NULL) || (oidValue == NULL))
     return NULL;               /* ASN1_ELEMENT_NOT_FOUND; */
 
-
-  strcpy (definitionsName, definitions->name);
-  strcat (definitionsName, ".");
+  definitionsName = definitions->name;
 
   /* search the OBJECT_ID into definitions */
   p = definitions->down;
@@ -1107,8 +1106,7 @@ asn1_find_structure_from_oid (asn1_node definitions, 
const char *oidValue)
       if ((type_field (p->type) == ASN1_ETYPE_OBJECT_ID) &&
          (p->type & CONST_ASSIGN))
        {
-         strcpy (name, definitionsName);
-         strcat (name, p->name);
+          snprintf(name, sizeof(name), "%s.%s", definitionsName, p->name);
 
          len = ASN1_MAX_NAME_SIZE;
          result = asn1_read_value (definitions, name, value, &len);


hooks/post-receive
-- 
GNU libtasn1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]