<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p class="details" style="font-style: italic; color: #777;">
<a href="https://gitlab.com/rockdaboot">Tim Rühsen</a> created an issue:
</p>
<div></div>
<p dir="auto">The following call sequence eats up memory while running in an (endless) loop:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">if (asn1_parser2tree("infile", &definitions, errorDescription) == ASN1_SUCCESS)</span>
<span id="LC2" class="line" lang="plaintext">  asn1_create_element(definitions, "TEST_TREE.Koko", &asn1_element);</span></code></pre>
<p dir="auto">with <code>infile</code> being</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TEST_TREE { }</span>
<span id="LC2" class="line" lang="plaintext">DEFINITIONS IMPLICIT TAGS ::=</span>
<span id="LC3" class="line" lang="plaintext">BEGIN</span>
<span id="LC4" class="line" lang="plaintext">Koko ::= SEQUENCE {</span>
<span id="LC5" class="line" lang="plaintext">  x ?L</span>
<span id="LC6" class="line" lang="plaintext">}</span>
<span id="LC7" class="line" lang="plaintext">END</span></code></pre>
<p dir="auto">Easiest way to reproduce:</p>
<ul dir="auto">
<li>git checkout tmp-fuzzing</li>
<li>./bootstrap && ./configure && make && cd fuzz</li>
<li>make check TESTS=libtasn1_encoding_fuzzer</li>
</ul>
<p dir="auto">You have to CTRL-C to stop it. It hangs in <code>_asn1_expand_identifier()</code>, each loop iteration running through the code block of <code>if (type_field (p->type) == ASN1_ETYPE_IDENTIFIER)</code>.</p>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/libtasn1/issues/22">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/sent_notifications/544b9c860e665ef53a6bb4309bdd4c78/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/libtasn1/issues/22"}}</script>


</p>
</div>
</body>
</html>