[xiph-commits] r13547 - icecast/trunk/icecast/win32

karl at svn.xiph.org karl at svn.xiph.org
Tue Aug 14 16:00:32 PDT 2007


Author: karl
Date: 2007-08-14 16:00:32 -0700 (Tue, 14 Aug 2007)
New Revision: 13547

Modified:
   icecast/trunk/icecast/win32/Icecast2winDlg.cpp
Log:
update for win32 build. Allow for more source stats and add boundary check


Modified: icecast/trunk/icecast/win32/Icecast2winDlg.cpp
===================================================================
--- icecast/trunk/icecast/win32/Icecast2winDlg.cpp	2007-08-14 04:10:12 UTC (rev 13546)
+++ icecast/trunk/icecast/win32/Icecast2winDlg.cpp	2007-08-14 23:00:32 UTC (rev 13547)
@@ -43,7 +43,7 @@
 char	gTitleSource[1024] = "";
 char	gTitleName[1024] = "";
 
-#define MAXSTATSPERSOURCE 30
+#define MAXSTATSPERSOURCE 60
 #define MAXSOURCES 1024
 
 typedef struct tagElement {
@@ -472,6 +472,8 @@
 		}
 	}
 	int numStats = gStats[sourceIndex].numStats;
+    if (numStats >= MAXSTATSPERSOURCE)
+        return;
 	/* If we get here, we haven't found the stat, so add it */
 	gStats[sourceIndex].stats[numStats].name = name;
 	gStats[sourceIndex].stats[numStats].value = value;
@@ -488,6 +490,8 @@
 			return i;
 		}
 	}
+    if (numMainStats >= MAXSOURCES)
+        return 0;
 	/* This means we haven't seen the source, so lets add it */
 	numMainStats++;
 	gStats[numMainStats].source = sourceName;
@@ -537,7 +541,7 @@
 
 			xmlDocPtr doc;
 
-			stats_get_xml(&doc, 0);
+			stats_get_xml(&doc, 0, NULL);
 			xmlNodePtr cur;
 		    cur = xmlDocGetRootElement(doc); 
 



More information about the commits mailing list