Revision
14910
Author
anthm
Date
2009-09-17 16:49:55 -0500 (Thu, 17 Sep 2009)

Log Message

avoiding buffer overflow in silly iax lib

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/iax2-parser.c (14909 => 14910)


--- freeswitch/trunk/src/mod/endpoints/mod_iax/iax2-parser.c	2009-09-17 21:38:04 UTC (rev 14909)
+++ freeswitch/trunk/src/mod/endpoints/mod_iax/iax2-parser.c	2009-09-17 21:49:55 UTC (rev 14910)
@@ -363,6 +363,8 @@
 		"FWDOWNLD",
 		"FWDATA"
 	};
+
+
 	const char *cmds[] = {
 		"(0?)",
 		"HANGUP ",
@@ -370,9 +372,26 @@
 		"RINGING",
 		"ANSWER ",
 		"BUSY   ",
-		"TKOFFHK ",
-		"OFFHOOK"
+		"TKOFFHK",
+		"OFFHOOK",
+		"CONGSTN",
+		"FLASH  ",
+		"WINK   ",
+		"OPTION ",
+		"RDKEY  ",
+		"RDUNKEY",
+		"PROGRES",
+		"PROCDNG",
+		"HOLD   ",
+		"UNHOLD ",
+		"VIDUPDT",
+		"T38    ",
+		"SRCUPDT",
+		"TXFER  ",
+		"CNLINE ",
+		"REDIR  ",
 	};
+
 	struct ast_iax2_full_hdr *fh;
 	char retries[20];
 	char class2[20];
@@ -423,14 +442,6 @@
 		subclass = subclass2;
 	}
 
-	if (!subclass) {
-		subclass = "";
-	}
-
-	if (!class) {
-		class = "";
-	}
-
 	snprintf(tmp, (int) sizeof(tmp),
 			 "%s-Frame Retry[%s] -- OSeqno: %3.3d ISeqno: %3.3d Type: %s Subclass: %s\n",
 			 (rx ? "Rx" : "Tx"), retries, fh->oseqno, fh->iseqno, class, subclass);