<!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/mpitt1">Martin Pitt</a> created an issue:
</p>
<div></div>
<p dir="auto">valgrind detects some code in <code>gnutls_x509_crt_print()</code> that depends on uninitialized data:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">$ gcc -o /tmp/t -Wall gnutls-crt-print.c -lgnutls</span>
<span id="LC2" class="line" lang="plaintext">$ valgrind  /tmp/t</span>
<span id="LC3" class="line" lang="plaintext">==10529== Memcheck, a memory error detector</span>
<span id="LC4" class="line" lang="plaintext">==10529== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.</span>
<span id="LC5" class="line" lang="plaintext">==10529== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info</span>
<span id="LC6" class="line" lang="plaintext">==10529== Command: /tmp/t</span>
<span id="LC7" class="line" lang="plaintext">==10529== </span>
<span id="LC8" class="line" lang="plaintext">==10529== Conditional jump or move depends on uninitialised value(s)</span>
<span id="LC9" class="line" lang="plaintext">==10529==    at 0x48FA861: decode_complex_string.isra.0 (common.c:395)</span>
<span id="LC10" class="line" lang="plaintext">==10529==    by 0x48FABEE: _gnutls_x509_dn_to_string (common.c:464)</span>
<span id="LC11" class="line" lang="plaintext">==10529==    by 0x4909F37: append_elements (dn.c:160)</span>
<span id="LC12" class="line" lang="plaintext">==10529==    by 0x490A3B7: _gnutls_x509_get_dn (dn.c:236)</span>
<span id="LC13" class="line" lang="plaintext">==10529==    by 0x491040B: print_oneline (output.c:1881)</span>
<span id="LC14" class="line" lang="plaintext">==10529==    by 0x491597F: gnutls_x509_crt_print (output.c:2076)</span>
<span id="LC15" class="line" lang="plaintext">==10529==    by 0x40125D: main (in /tmp/t)</span>
<span id="LC16" class="line" lang="plaintext">==10529== </span>
<span id="LC17" class="line" lang="plaintext">cert: subject `CN=localhost', issuer `CN=localhost', serial 0x00ec5dca0f931ef8ab, RSA key 2048 bits, signed using RSA-SHA256, activated `2015-05-15 19:54:08 UTC', expires `2115-04-21 19:54:08 UTC', pin-sha256="p5szU3vH77RKSNI7ciu7Gtqa9TUJv23iYQGeyejBMYc="==10529== </span>
<span id="LC18" class="line" lang="plaintext">==10529== HEAP SUMMARY:</span>
<span id="LC19" class="line" lang="plaintext">==10529==     in use at exit: 0 bytes in 0 blocks</span>
<span id="LC20" class="line" lang="plaintext">==10529==   total heap usage: 1,586 allocs, 1,586 frees, 162,017 bytes allocated</span>
<span id="LC21" class="line" lang="plaintext">==10529== </span>
<span id="LC22" class="line" lang="plaintext">==10529== All heap blocks were freed -- no leaks are possible</span>
<span id="LC23" class="line" lang="plaintext">==10529== </span>
<span id="LC24" class="line" lang="plaintext">==10529== Use --track-origins=yes to see where uninitialised values come from</span>
<span id="LC25" class="line" lang="plaintext">==10529== For lists of detected and suppressed errors, rerun with: -s</span>
<span id="LC26" class="line" lang="plaintext">==10529== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 0 from 0)</span></code></pre>
<p dir="auto">The reproducer is so simple that I don't see how I should have introduced uninitialized data into it myself.</p>
<p dir="auto">This happens at least with GnuTLS 3.6.8 (in Fedora 30) and 3.6.9 (in rawhide).</p>
<p dir="auto">Reproducer: <a href="https://gitlab.com/gnutls/gnutls/uploads/ff8f3d85fd5e74f529e5396b3010104f/gnutls-crt-print.c">gnutls-crt-print.c</a></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/gnutls/issues/833">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/b61902f12691ec5a3e4bfe83a438a008/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/gnutls/issues/833"}}</script>


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