mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Fix read-beyond-buffer
This commit is contained in:
parent
7fa9eb76a8
commit
49709e76b9
@ -12627,7 +12627,10 @@ void load_config_section(char *section, char **buffer, char *error) {
|
||||
while (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\r')
|
||||
p++;
|
||||
}
|
||||
memmove(*buffer, p, length);
|
||||
int n = length;
|
||||
if ((int)strlen(p)+1 < n)
|
||||
n = strlen(p)+1;
|
||||
memmove(*buffer, p, n);
|
||||
if ((p = (char *) find_next_section(*buffer + 1)) != NULL) {
|
||||
*p = 0;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user