From 6b196e011fa456499ed4650a360961a2f1323818 Mon Sep 17 00:00:00 2001
From: NickSampanis <nicksampanis@gmail.com>
Date: Fri, 17 Oct 2014 21:00:41 +0300
Subject: [PATCH] Fix cvs ignore end checking
---
src/dissectors/ec_cvs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/dissectors/ec_cvs.c b/src/dissectors/ec_cvs.c
index ff19b60..f6195c6 100644
--- a/src/dissectors/ec_cvs.c
+++ b/src/dissectors/ec_cvs.c
@@ -96,16 +96,16 @@ FUNC_DECODER(dissector_cvs)
/* move over the cvsroot path */
ptr += strlen(CVS_LOGIN) + 1;
+ if (ptr >= end)
+ return NULL;
/* go until \n */
while(*ptr != '\n' && ptr != end) ptr++;
if (ptr == end) return NULL;
-
PACKET->DISSECTOR.user = strdup((const char*)++ptr);
/* cut the username on \n */
if ( (p = strchr(PACKET->DISSECTOR.user, '\n')) != NULL )
*p = '\0';
-
/* go until \n */
while(*ptr != '\n' && ptr != end) ptr++;
if (ptr == end) return NULL;