All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH v7] block/vvfat: assert return value of fopen which may fail
@ 2014-08-18  8:00 ` zhanghailiang
  0 siblings, 0 replies; 8+ messages in thread
From: zhanghailiang @ 2014-08-18  8:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, zhanghailiang, qemu-trivial, Li Liu, luonengjun,
	peter.huangpeng, stefanha

From: Li Liu <john.liuli@huawei.com>

fopen() may return NULL which will cause setbuf() segmentfault

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Li Liu <john.liuli@huawei.com>
---
 block/vvfat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/vvfat.c b/block/vvfat.c
index 70176b1..62023e1 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -1084,6 +1084,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
 
 DLOG(if (stderr == NULL) {
     stderr = fopen("vvfat.log", "a");
+    assert(stderr);
     setbuf(stderr, NULL);
 })
 
-- 
1.7.12.4




^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-08-19  6:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18  8:00 [Qemu-trivial] [PATCH v7] block/vvfat: assert return value of fopen which may fail zhanghailiang
2014-08-18  8:00 ` [Qemu-devel] " zhanghailiang
2014-08-18  8:06 ` [Qemu-trivial] " Peter Maydell
2014-08-18  8:06   ` Peter Maydell
2014-08-18 11:42   ` [Qemu-trivial] " Michael Tokarev
2014-08-18 11:42     ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2014-08-19  6:28     ` [Qemu-trivial] [Qemu-devel] " zhanghailiang
2014-08-19  6:28       ` [Qemu-devel] [Qemu-trivial] " zhanghailiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.