[iortcw] 269/497: All: Ensure that mbstowcs does not overflow its buffer
Simon McVittie
smcv at debian.org
Wed Sep 21 19:48:29 UTC 2016
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 d1735b2fe20a51a6925ac7aed9a3c6215f09dd26
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date: Thu Jan 8 23:04:39 2015 +0000
All: Ensure that mbstowcs does not overflow its buffer
---
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);
}
--
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