author | Sebastian Harl <sh@tokkee.org> | |
Thu, 28 Nov 2013 16:34:56 +0000 (17:34 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 28 Nov 2013 16:34:56 +0000 (17:34 +0100) | ||
commit | c3271a967dc7e221b657cbf420882b605d5c261e | |
tree | 648fa5a72d15ac0d267e91569a711d0e61d0d1ab | tree | snapshot |
parent | f9a304a377a9879fab33bb16d9334ce914abf55f | commit | diff |
utils strbuf: Handle nul-byte correctly.
A corner-case was not handled correctly before: when writing just enough
characters to the buffer that it would then be full, a resize was attempted
without changing the size of the buffer, leading to an endless loop in
vappend(). This was caused by not taking into account the space required for
the trailing nul-byte.
A test-case which exposes this problem has also been added.
A corner-case was not handled correctly before: when writing just enough
characters to the buffer that it would then be full, a resize was attempted
without changing the size of the buffer, leading to an endless loop in
vappend(). This was caused by not taking into account the space required for
the trailing nul-byte.
A test-case which exposes this problem has also been added.
src/utils/strbuf.c | diff | blob | history | |
t/utils/strbuf_test.c | diff | blob | history |