Skip to content
Snippets Groups Projects
Commit 9bbcb23f authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Prevent assertion failure due to currupt binary string representation (missing \0).

parent 27dc72bd
No related branches found
No related tags found
No related merge requests found
......@@ -316,6 +316,7 @@ bool sieve_binary_read_string
(struct sieve_binary_block *sblock, sieve_size_t *address, string_t **str_r)
{
unsigned int strlen = 0;
const char *strdata;
ADDR_CODE_READ(sblock);
......@@ -325,12 +326,14 @@ bool sieve_binary_read_string
if ( strlen > ADDR_BYTES_LEFT(address) )
return FALSE;
if ( str_r != NULL )
*str_r = t_str_new_const((const char *) ADDR_POINTER(address), strlen);
strdata = (const char *) ADDR_POINTER(address);
ADDR_JUMP(address, strlen);
if ( ADDR_CODE_AT(address) != 0 )
return FALSE;
if ( str_r != NULL )
*str_r = t_str_new_const(strdata, strlen);
ADDR_JUMP(address, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.