]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commit
rrd_client: avoid invalid read
authorDerrick Lyndon Pallas <derrick@argosylabs.com>
Tue, 3 Sep 2019 20:39:33 +0000 (20:39 +0000)
committerTobias Oetiker <tobi@oetiker.ch>
Wed, 4 Sep 2019 09:02:34 +0000 (11:02 +0200)
commit53586d61ef52d1819e7a7040c44981ed7871eda0
treea5de4308c0550784f672b82b727f7adc113ba3b5
parenta8e782dca42411c82148f2454d3123cf7a724a18
rrd_client: avoid invalid read

In rrd_client_last and rrd_client_first, the response value is in the
message prior to any additional lines.  Unfortunately, the buffer that
contains this data is on the stack for response_read and is no longer valid
by the time the caller sees it.

This change strdups the message line in response_read and subsequently frees
it in response_free.

Resolves issue #1047.
src/rrd_client.c