fix valgrind-noted empty array cruft.

This commit is contained in:
Eric House 2019-02-22 19:29:56 -08:00
parent 1e0db1fca7
commit 956e9c540f

View file

@ -202,13 +202,16 @@ linux_dutil_loadStream( XW_DUtilCtxt* duc, const XP_UCHAR* key,
{
XP_U16 len = 0;
linux_dutil_loadPtr( duc, key, NULL, &len );
XP_U8 buf[len];
linux_dutil_loadPtr( duc, key, buf, &len );
if ( 0 < len ) {
XP_U8 buf[len];
linux_dutil_loadPtr( duc, key, buf, &len );
XP_ASSERT( buf[len-1] == '\0' );
gsize out_len;
guchar* txt = g_base64_decode( (const gchar*)buf, &out_len );
stream_putBytes( stream, txt, out_len );
g_free( txt );
gsize out_len;
guchar* txt = g_base64_decode( (const gchar*)buf, &out_len ); /* BAD */
stream_putBytes( stream, txt, out_len );
g_free( txt );
}
XP_LOGF( "%s(key=%s) => len: %d", __func__, key, stream_getSize(stream) );
}