[iortcw] 05/10: Ensure that lengths passed to mbstowcs are in-bounds
Simon McVittie
smcv at debian.org
Sun Jan 4 21:54:17 UTC 2015
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch master
in repository iortcw.
commit 2f88cf299b2e2f9181c5ce56fa65c7e2046bf017
Author: Simon McVittie <smcv at debian.org>
Date: Sun Jan 4 10:54:55 2015 +0000
Ensure that lengths passed to mbstowcs are in-bounds
---
...-lengths-passed-to-mbstowcs-are-in-bounds.patch | 54 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 55 insertions(+)
diff --git a/debian/patches/Ensure-that-lengths-passed-to-mbstowcs-are-in-bounds.patch b/debian/patches/Ensure-that-lengths-passed-to-mbstowcs-are-in-bounds.patch
new file mode 100644
index 0000000..aa76c1b
--- /dev/null
+++ b/debian/patches/Ensure-that-lengths-passed-to-mbstowcs-are-in-bounds.patch
@@ -0,0 +1,54 @@
+From: Simon McVittie <smcv at debian.org>
+Date: Sat, 3 Jan 2015 23:50:09 +0000
+Subject: Ensure that lengths passed to mbstowcs are in-bounds
+
+Similar to part of ioquake3 commit fd986da by Tim Angus.
+---
+ MP/code/client/libmumblelink.c | 4 ++--
+ SP/code/client/libmumblelink.c | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/MP/code/client/libmumblelink.c b/MP/code/client/libmumblelink.c
+index b4323d0..4b01b82 100644
+--- a/MP/code/client/libmumblelink.c
++++ b/MP/code/client/libmumblelink.c
+@@ -146,7 +146,7 @@ void mumble_set_identity(const char* identity)
+ size_t len;
+ if (!lm)
+ return;
+- len = MIN(sizeof(lm->identity), strlen(identity)+1);
++ len = MIN(sizeof(lm->identity)/sizeof(wchar_t), strlen(identity)+1);
+ mbstowcs(lm->identity, identity, len);
+ }
+
+@@ -164,7 +164,7 @@ void mumble_set_description(const char* description)
+ size_t len;
+ if (!lm)
+ return;
+- len = MIN(sizeof(lm->description), strlen(description)+1);
++ len = MIN(sizeof(lm->description)/sizeof(wchar_t), strlen(description)+1);
+ mbstowcs(lm->description, description, len);
+ }
+
+diff --git a/SP/code/client/libmumblelink.c b/SP/code/client/libmumblelink.c
+index b4323d0..4b01b82 100644
+--- a/SP/code/client/libmumblelink.c
++++ b/SP/code/client/libmumblelink.c
+@@ -146,7 +146,7 @@ void mumble_set_identity(const char* identity)
+ size_t len;
+ if (!lm)
+ return;
+- len = MIN(sizeof(lm->identity), strlen(identity)+1);
++ len = MIN(sizeof(lm->identity)/sizeof(wchar_t), strlen(identity)+1);
+ mbstowcs(lm->identity, identity, len);
+ }
+
+@@ -164,7 +164,7 @@ void mumble_set_description(const char* description)
+ size_t len;
+ if (!lm)
+ return;
+- len = MIN(sizeof(lm->description), strlen(description)+1);
++ len = MIN(sizeof(lm->description)/sizeof(wchar_t), strlen(description)+1);
+ mbstowcs(lm->description, description, len);
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
index a06a8f1..a4cef4e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
Default-to-non-fullscreen.patch
+Ensure-that-lengths-passed-to-mbstowcs-are-in-bounds.patch
--
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