mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-16 10:36:55 +00:00
BUG/MINOR: ist: only store NUL byte on succeeded alloc
The trailing NUL added at the end of istdup() by recent commit de0216758
("BUG/MINOR: ist: allocate nul byte on istdup") was placed outside of
the pointer validity test, rightfully showing null deref warnings. This
fix should be backported along with the fix above, to the same versions.
This commit is contained in:
parent
3f771f5118
commit
a4d44250eb
@ -944,8 +944,8 @@ static inline struct ist istdup(const struct ist src)
|
||||
|
||||
if (isttest(dst)) {
|
||||
istcpy(&dst, src, src.len);
|
||||
dst.ptr[dst.len] = '\0';
|
||||
}
|
||||
dst.ptr[dst.len] = '\0';
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user