changeset 2271:fd2c3f3def9d

* src/monitor.c (cyg_monitor_network): Calling the network monitor html handler can trigger an exception when the function getifaddrs() fails because we are out of memory. Check the return code and return failure if this happens.
author asl
date Fri, 11 Aug 2006 15:54:45 +0000
parents 0b2803660786
children e5c118746536
files packages/net/httpd/current/ChangeLog packages/net/httpd/current/src/monitor.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/httpd/current/ChangeLog
+++ b/packages/net/httpd/current/ChangeLog
@@ -1,3 +1,10 @@
+2006-07-28  Jochen Gerster <JochenGerster@gmx.de>
+
+	* src/monitor.c (cyg_monitor_network): Calling the network monitor
+	  html handler can trigger an exception when the function
+	  getifaddrs() fails because we are out of memory. Check the
+	  return code and return failure if this happens.
+	
 2005-07-30  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/httpd.c (cyg_httpd_server): Use socklen_t to avoid compiler
--- a/packages/net/httpd/current/src/monitor.c
+++ b/packages/net/httpd/current/src/monitor.c
@@ -702,7 +702,8 @@ static cyg_bool cyg_monitor_network( FIL
 {
     struct ifaddrs *iflist, *ifp;
 
-    getifaddrs(&iflist);
+    if(getifaddrs(&iflist)!=0)
+        return 0;
     
     html_begin(client);