The previous patch would be confusing to anybody reading it :-)
The intent of the original (unpatched) code
if (value[last_char_index] == ';')
value[last_char_index] = '\0';
was to remove the last character of the string, if it was a semicolon.
If the string was of zero length, the previous patch I uploaded caused a comparison of '\0' against ';', which would always fail, so the patch worked. But this patch only does the test if there are any characters to actually look at.
The previous patch would be confusing to anybody reading it :-)
The intent of the original (unpatched) code last_char_ index] == ';') last_char_ index] = '\0';
if (value[
value[
was to remove the last character of the string, if it was a semicolon.
If the string was of zero length, the previous patch I uploaded caused a comparison of '\0' against ';', which would always fail, so the patch worked. But this patch only does the test if there are any characters to actually look at.