On 2014/9/18 20:17, Eric Blake wrote:
On 09/17/2014 09:33 PM, zhanghailiang wrote:
If readdir_r fails, error_setg_errno will reference the freed
pointer *dirpath*.

Signed-off-by: zhanghailiang <zhang.zhanghaili...@huawei.com>
---
  qga/commands-posix.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)

      for (;;) {
          if (readdir_r(dir, &entry, &result) != 0) {

Eww.  We're using readdir_r?  That's an inherently broken interface,
which can risk buffer overflow.  readdir should be preferred.

http://austingroupbugs.net/view.php?id=696


Yes, it is! Should i fix it in this patch together?;)

Thanks,
zhanghailiang


Reply via email to