This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] fix memory corruption in Get_Command_Output


Tested on i686-linux, committed on trunk

This patch fixes a memory corruption bug in Get_Command_Output.
This function read the standard output of a spawned command into
a buffer. This buffer is expanded when the read data is too big for
the buffer. This patch fixes the expanded buffer size computation
so there is always enough place to fit the read data and no data is
written outside the buffer bounds.

2007-04-06  Arnaud Charlet  <charlet@adacore.com>

	* g-expect.adb (Get_Command_Output): When expanding the output buffer
	we must ensure that there is enough place for the new data we are going
	to copy in.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]