<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style='--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;'>
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>

<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>

<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: var(--default-regular-font, "GitLab Sans"),-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px; font-family: var(--default-regular-font, "GitLab Sans"),-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";'>
<div class="content">

<p class="details" style="font-style: italic; color: #737278;">
<a href="https://gitlab.com/garycplin">Gary Lin</a> created an issue: <a href="https://gitlab.com/gnutls/libtasn1/-/issues/50">#50</a>
</p>
<div class="md" style="color: #333238; word-wrap: break-word;">
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #333238; margin: 0 0 16px;" align="initial">
<a id="user-content-description-of-problem" class="anchor" href="#description-of-problem" aria-hidden="true" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Description of problem:</h2>
<p dir="auto" style="color: #333238; margin: 0 0 16px;" align="initial">From the grub2 <a href="https://lists.gnu.org/archive/html/grub-devel/2024-02/txtKIuUb5lf3O.txt" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">coverity report</a>, it raised a potential buffer overrun in asn1_der_decoding2():</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" v-pre="true" style='display: block; font-size: 14px; color: #333238; line-height: 1.6em; overflow-x: auto; border-radius: 4px; position: relative; font-family: var(--default-mono-font, "GitLab Mono"),"JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; margin: 0 0 16px; padding: 12px; border: 1px solid #dcdcde;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: 4px; white-space: pre; margin-top: 0; font-family: var(--default-mono-font, "GitLab Mono"),"JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">________________________________________________________________________________________________________</span>
<span id="LC2" class="line" lang="plaintext">*** CID 435766:  Memory - corruptions  (OVERRUN)</span>
<span id="LC3" class="line" lang="plaintext">/grub-core/lib/libtasn1/lib/decoding.c: 1204 in asn1_der_decoding2()</span>
<span id="LC4" class="line" lang="plaintext">1198                   }</span>
<span id="LC5" class="line" lang="plaintext">1199     </span>
<span id="LC6" class="line" lang="plaintext">1200                 DECR_LEN (ider_len, len2);</span>
<span id="LC7" class="line" lang="plaintext">1201     </span>
<span id="LC8" class="line" lang="plaintext">1202                 tlen = strlen (temp);</span>
<span id="LC9" class="line" lang="plaintext">1203                 if (tlen > 0)</span>
<span id="LC10" class="line" lang="plaintext">>>>     CID 435766:  Memory - corruptions  (OVERRUN)</span>
<span id="LC11" class="line" lang="plaintext">>>>     Allocating insufficient memory for the terminating null of the string.</span>
<span id="LC12" class="line" lang="plaintext">1204                  _asn1_set_value (p, temp, tlen);</span>
<span id="LC13" class="line" lang="plaintext">1205     </span>
<span id="LC14" class="line" lang="plaintext">1206                counter += len2;</span>
<span id="LC15" class="line" lang="plaintext">1207                move = RIGHT;</span>
<span id="LC16" class="line" lang="plaintext">1208                break;</span>
<span id="LC17" class="line" lang="plaintext">1209              case ASN1_ETYPE_OCTET_STRING:</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto" style="color: #333238; margin: 0 0 16px;" align="initial">However, this seems to be false positive since DER format doesn't need the terminating null. I'd need the confirmation from libtasn1 upstream.</p>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #333238; margin: 24px 0 16px;" align="initial">
<a id="user-content-version-of-libtasn1-used" class="anchor" href="#version-of-libtasn1-used" aria-hidden="true" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Version of libtasn1 used:</h2>
<p dir="auto" style="color: #333238; margin: 0 0 16px;" align="initial">4.19</p>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #333238; margin: 24px 0 16px;" align="initial">
<a id="user-content-distributor-of-libtasn1-eg-ubuntu-fedora-rhel" class="anchor" href="#distributor-of-libtasn1-eg-ubuntu-fedora-rhel" aria-hidden="true" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Distributor of libtasn1 (e.g., Ubuntu, Fedora, RHEL)</h2>
<p dir="auto" style="color: #333238; margin: 0 0 16px;" align="initial">Upstream official tarball</p>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #333238; margin: 24px 0 16px;" align="initial">
<a id="user-content-how-reproducible" class="anchor" href="#how-reproducible" aria-hidden="true" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>How reproducible:</h2>
<p dir="auto" style="color: #333238; margin: 0 0 16px;" align="initial">Steps to Reproduce:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 16px; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">one</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">two</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">three</li>
</ul>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #333238; margin: 24px 0 16px;" align="initial">
<a id="user-content-actual-results" class="anchor" href="#actual-results" aria-hidden="true" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Actual results:</h2>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: .3em; border-bottom-width: 1px; border-bottom-color: #bfbfc3; border-bottom-style: solid; color: #333238; margin: 24px 0 0;" align="initial">
<a id="user-content-expected-results" class="anchor" href="#expected-results" aria-hidden="true" style="margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Expected results:</h2>
</div>

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

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/libtasn1/-/issues/50">view it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.com">gitlab.com</a>. <a href="https://gitlab.com/-/sent_notifications/a3f25aa6fc8854995e25fb9ac774dc57/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.com/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.com/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/libtasn1/-/issues/50"}}</script>


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