help-libtasn1
[Top][All Lists]
Advanced

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

Fix segfault when deleting an unauthorized element


From: Jean-Louis Thekekara
Subject: Fix segfault when deleting an unauthorized element
Date: Tue, 25 Mar 2014 17:27:07 +0100

Dear maintainers,

This patch ensures libtasn1 does not segfault when asked to delete an
unauthorized element (neither optional nor sequence of/set of).

This patch applies on top on my previous submitted patches.

That's the simplest patch I could come up with. But the logic could be
rewritten by testing first value element (instead of testing first type
element). Something like :

if (value == NULL)
  {
    if ((node->type & CONST_OPTION) && (len == 0))
      ...
    else if ((type == ASN1_ETYPE_SEQUENCE_OF || type ==
ASN1_ETYPE_SET_OF) && (len == 0))
      ...
    else
      return ASN1_VALUE_NOT_VALID;
  }

-- 
Jean-Louis Thekekara - OpenWide Ingénierie
http://ingenierie.openwide.fr
http://www.linuxembedded.fr

Attachment: 0001-asn1_write_value-fix-segfault-when-deleting-an-unaut.patch
Description: Text Data


reply via email to

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