]> git.ipfire.org Git - thirdparty/openvpn.git/commit
buffer: Fix buf_parse eating input
authorFrank Lichtenheld <frank@lichtenheld.com>
Wed, 8 Oct 2025 10:29:55 +0000 (12:29 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 8 Oct 2025 10:36:18 +0000 (12:36 +0200)
commitf5a2e2319bc7c3cce7f5cdccae44b9bae3e33375
tree1bad75bd2923d4af1b0054649a8204318bdd51c1
parent80981cf33880d9bf995da0dbd09becedce421d5e
buffer: Fix buf_parse eating input

When parsing a "line" that is longer than the
available line buffer, then buf_parse was
eating up to 2 characters. It advanced past
them but they were not part of the output.

This can lead to unexpected results if buf_parse
is used in a while loop on unrestricted input,
like e.g. when reading configs (see in_src_get()
used for check_inline_file_via_buf()).

Change-Id: I3724660bf0f8336ee58c172acfb7c4f38e457393
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1246
Message-Id: <20251008103001.7696-1-gert@greenie.muc.de>
URL: https://sourceforge.net/p/openvpn/mailman/message/59243829/
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/buffer.c
src/openvpn/buffer.h
tests/unit_tests/openvpn/test_buffer.c