]> git.ipfire.org Git - thirdparty/curl.git/commit
tool_cb_hdr: add an additional parsing check
authorJay Satiro <raysatiro@yahoo.com>
Tue, 14 Nov 2023 06:19:14 +0000 (01:19 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 14 Nov 2023 09:14:01 +0000 (04:14 -0500)
commitefbbbf4f7a92cc1b6bd5d86b0da567e7c71d0d04
tree8ae4d81d2f67be6af5aef5b4558acfbfc50ccbf4
parent50bf253357a2c7d61bb136737c15df7350e2f303
tool_cb_hdr: add an additional parsing check

- Don't dereference the past-the-end element when parsing the server's
  Content-disposition header.

As 'p' is advanced it can point to the past-the-end element and prior
to this change 'p' could be dereferenced in that case.

Technically the past-the-end element is not out of bounds because dynbuf
(which manages the header line) automatically adds a null terminator to
every buffer and that is not included in the buffer length passed to
the header callback.

Closes https://github.com/curl/curl/pull/12320
src/tool_cb_hdr.c