summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Schlossnagle <jesus@omniti.com>2012-02-01 19:59:23 -0800
committerJohn Sonnenschein <johns@joyent.com>2012-03-13 03:37:11 +0000
commitbea19e8cc0dc2da6310e028c2f3efb4881c366e1 (patch)
tree82ae0a8f14da8545eb7204eb7ddced761ffc9efe
parent34e9220397a0e9586c80ec37190ae94174142200 (diff)
downloadillumos-joyent-bea19e8cc0dc2da6310e028c2f3efb4881c366e1.tar.gz
1594 strxfrm may write past the specified buffer
Reviewed by: Garrett D'Amore <garrett@damore.org> Reviewed by: Richard Lowe <richlowe@richlowe.net> Reviewed by: Adam Leventhal <ahl@delphix.com> Reviewed by: Dan McDonald <danmcd@nexenta.com> Approved by: Garrett D'Amore <garrett@damore.org>
-rw-r--r--usr/src/lib/libc/port/locale/collate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr/src/lib/libc/port/locale/collate.c b/usr/src/lib/libc/port/locale/collate.c
index 5428f7aa94..9064ca685f 100644
--- a/usr/src/lib/libc/port/locale/collate.c
+++ b/usr/src/lib/libc/port/locale/collate.c
@@ -588,9 +588,10 @@ _collate_sxfrm(const wchar_t *src, char *xf, size_t room)
if (room) {
while (b) {
b--;
- if (room)
+ if (room) {
*xf++ = buf[b];
- room--;
+ room--;
+ }
}
}
need = want;
@@ -613,9 +614,10 @@ _collate_sxfrm(const wchar_t *src, char *xf, size_t room)
while (b) {
b--;
- if (room)
+ if (room) {
*xf++ = buf[b];
- room--;
+ room--;
+ }
}
}
need = want;