[iortcw] 145/497: All: Fix SkipRestOfLine going past end of string

Simon McVittie smcv at debian.org
Fri Sep 8 10:36:40 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit e85f760901ac9ecf9576843e260d2adbedb241c5
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Thu Jun 19 04:30:22 2014 +0000

    All: Fix SkipRestOfLine going past end of string
---
 MP/code/qcommon/q_shared.c | 4 ++++
 SP/code/qcommon/q_shared.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/MP/code/qcommon/q_shared.c b/MP/code/qcommon/q_shared.c
index ee88b62..5b96357 100644
--- a/MP/code/qcommon/q_shared.c
+++ b/MP/code/qcommon/q_shared.c
@@ -638,6 +638,10 @@ void SkipRestOfLine( char **data ) {
 	int c;
 
 	p = *data;
+
+	if ( !*p )
+		return;
+
 	while ( ( c = *p++ ) != 0 ) {
 		if ( c == '\n' ) {
 			com_lines++;
diff --git a/SP/code/qcommon/q_shared.c b/SP/code/qcommon/q_shared.c
index a9a7e19..2c6a455 100644
--- a/SP/code/qcommon/q_shared.c
+++ b/SP/code/qcommon/q_shared.c
@@ -676,6 +676,10 @@ void SkipRestOfLine( char **data ) {
 	int c;
 
 	p = *data;
+
+	if ( !*p )
+		return;
+
 	while ( ( c = *p++ ) != 0 ) {
 		if ( c == '\n' ) {
 			com_lines++;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list