devilhorns pushed a commit to branch master.
commit cc0bbacb8971fdb7ece1b168e53cb2001fd15f47
Author: Chris Michael <[email protected]>
Date: Mon Aug 5 11:34:34 2013 +0100
open() can fail for various reasons, so check for valid 'fd' return
before calling fdopen.
Signed-off-by: Chris Michael <[email protected]>
---
src/lib/eet/eet_lib.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c
index a8d507e..f85209a 100644
--- a/src/lib/eet/eet_lib.c
+++ b/src/lib/eet/eet_lib.c
@@ -351,6 +351,9 @@ eet_flush2(Eet_File *ef)
/* opening for write - delete old copy of file right away */
unlink(ef->path);
fd = open(ef->path, O_CREAT | O_TRUNC | O_RDWR | O_BINARY, S_IRUSR |
S_IWUSR);
+ if (fd < 0)
+ return EET_ERROR_NOT_WRITABLE;
+
fp = fdopen(fd, "wb");
if (!fp)
return EET_ERROR_NOT_WRITABLE;
--
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk