libselinux: do not add rc to pos twice
In regex_format_error(), when error_data->error_offset is zero, rc is not updated and should not be added to pos again. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
parent
340da085a5
commit
68b2e4416e
|
@ -552,10 +552,10 @@ void regex_format_error(struct regex_error_data const *error_data, char *buffer,
|
|||
#endif
|
||||
if (rc < 0)
|
||||
abort();
|
||||
}
|
||||
pos += rc;
|
||||
if (pos >= buf_size)
|
||||
goto truncated;
|
||||
}
|
||||
|
||||
#ifdef USE_PCRE2
|
||||
rc = pcre2_get_error_message(error_data->error_code,
|
||||
|
|
Loading…
Reference in New Issue