[iortcw] 365/497: All: Don't segfault in FS_CreatePath when there are no path seperators
Simon McVittie
smcv at debian.org
Fri Sep 8 10:37:29 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 3089f8398fc78ff10f5b71e7b725ac18e5b21694
Author: Donny <M4N4T4RMS at gmail.com>
Date: Mon Jul 13 07:12:51 2015 -0400
All: Don't segfault in FS_CreatePath when there are no path seperators
---
MP/code/qcommon/files.c | 4 +++-
SP/code/qcommon/files.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/MP/code/qcommon/files.c b/MP/code/qcommon/files.c
index 2e8184b..8e55976 100644
--- a/MP/code/qcommon/files.c
+++ b/MP/code/qcommon/files.c
@@ -540,7 +540,9 @@ qboolean FS_CreatePath( char *OSPath ) {
// Skip creation of the root directory as it will always be there
ofs = strchr( path, PATH_SEP );
- ofs++;
+ if ( ofs != NULL ) {
+ ofs++;
+ }
for (; ofs != NULL && *ofs ; ofs++) {
if (*ofs == PATH_SEP) {
diff --git a/SP/code/qcommon/files.c b/SP/code/qcommon/files.c
index 0d20647..02725a9 100644
--- a/SP/code/qcommon/files.c
+++ b/SP/code/qcommon/files.c
@@ -544,7 +544,9 @@ qboolean FS_CreatePath (char *OSPath) {
// Skip creation of the root directory as it will always be there
ofs = strchr( path, PATH_SEP );
- ofs++;
+ if ( ofs != NULL ) {
+ ofs++;
+ }
for (; ofs != NULL && *ofs ; ofs++) {
if (*ofs == PATH_SEP) {
--
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