mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 01:41:10 +00:00
fix an overflow bug
This commit is contained in:
parent
e38bf6dd98
commit
7ceea13e10
1 changed files with 1 additions and 1 deletions
|
@ -171,7 +171,7 @@ dstring_replace (dstring_t *dstr, unsigned int pos, unsigned int rlen,
|
|||
unsigned int oldsize = dstr->size;
|
||||
if (pos > dstr->size)
|
||||
pos = dstr->size;
|
||||
if (pos + rlen > dstr->size)
|
||||
if (rlen > dstr->size - pos)
|
||||
rlen = dstr->size - pos;
|
||||
if (rlen < len) {
|
||||
dstr->size += len - rlen;
|
||||
|
|
Loading…
Reference in a new issue