Skip to contentSkip to conversation

Return immediately when the ZOO file couldn't be opened, prevent crash later

PATCH In review Jiri Palecek 2 participants 2 messages Jun 8, 2009 – Jun 9, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Return immediately when the ZOO file couldn't be opened, prevent crash later

Hello,

there was a crash in pan when the zoofile couldn't be opened; this patch fixes it by disallowing the zoo_open function to continue.

Regards
Jiri Palecek

---
 pan/zoolib.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
pan/zoolib.c +1 -0
index 3e31733..72ddfb0 100644
@@ -104,6 +104,7 @@ zoo_open(char *zooname)
 		snprintf(zoo_error, ZELEN, 
 				"Could not open zoo as \"%s\", errno:%d %s", 
 				zooname, errno, strerror(errno));
+		return 0;
 	    }
 	    fclose(new_zoo);
 	    new_zoo = fopen(zooname, "r+");
Signature · 13 lines
1.6.2.4


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw
Quoted 8 lines · Jiri Palecek

Hello,

there was a crash in pan when the zoofile couldn't be opened; this patch fixes it by disallowing the zoo_open function to continue.

Regards
Jiri Palecek

Thanks.

Regards--
Subrata

Quoted 10 lines
---
 pan/zoolib.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
pan/zoolib.c +0 -0
index 3e31733..72ddfb0 100644

pan/zoolib.c zoo_open(char *zooname) · line 110

Quoted 7 lines
pan/zoolib.c +1 -0
@@ -104,6 +104,7 @@ zoo_open(char *zooname)
 		snprintf(zoo_error, ZELEN, 
 				"Could not open zoo as \"%s\", errno:%d %s", 
 				zooname, errno, strerror(errno));
+		return 0;
 	    }
 	    fclose(new_zoo);
 	    new_zoo = fopen(zooname, "r+");

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list