[glib] Avoid reading uninitialized memory
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glib] Avoid reading uninitialized memory
- Date: Mon, 7 Sep 2009 10:51:43 +0000 (UTC)
commit 8af494d987b7482865439f882d1375767b57732f
Author: Alexander Larsson <alexl redhat com>
Date: Mon Sep 7 12:50:58 2009 +0200
Avoid reading uninitialized memory
If the statfs call fails, don't look at the result.
gio/glocalfile.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gio/glocalfile.c b/gio/glocalfile.c
index 8ed1e09..bb14315 100644
--- a/gio/glocalfile.c
+++ b/gio/glocalfile.c
@@ -955,7 +955,8 @@ g_local_file_query_filesystem_info (GFile *file,
free == 0 case as "both of these are invalid".
*/
#ifndef G_OS_WIN32
- if (statfs_buffer.f_bavail == 0 && statfs_buffer.f_bfree == 0)
+ if (statfs_result == 0 &&
+ statfs_buffer.f_bavail == 0 && statfs_buffer.f_bfree == 0)
no_size = TRUE;
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]