diff options
author | marha <marha@users.sourceforge.net> | 2010-05-18 15:47:33 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-05-18 15:47:33 +0000 |
commit | df3634f34f1c14f6bbdc66d9e54478384fd93eae (patch) | |
tree | b73885574a3e6e6a39253e78c0246eac8e9e40d2 /xorg-server/xkb | |
parent | 96bd0f520fd4a3a8c54e76638985389f60d936e0 (diff) | |
download | vcxsrv-df3634f34f1c14f6bbdc66d9e54478384fd93eae.tar.gz vcxsrv-df3634f34f1c14f6bbdc66d9e54478384fd93eae.tar.bz2 vcxsrv-df3634f34f1c14f6bbdc66d9e54478384fd93eae.zip |
Solved out of memory buffer write. Should also allocate place for the null ending character of a string.
Diffstat (limited to 'xorg-server/xkb')
-rw-r--r-- | xorg-server/xkb/xkbUtils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xorg-server/xkb/xkbUtils.c b/xorg-server/xkb/xkbUtils.c index 286fab073..ab433a800 100644 --- a/xorg-server/xkb/xkbUtils.c +++ b/xorg-server/xkb/xkbUtils.c @@ -1977,7 +1977,7 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) /* font */
if (src->geom->label_font) {
if (!dst->geom->label_font) {
- tmp = malloc(strlen(src->geom->label_font));
+ tmp = malloc(strlen(src->geom->label_font) + 1);
if (!tmp)
return FALSE;
dst->geom->label_font = tmp;
@@ -1985,7 +1985,7 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) else if (strlen(src->geom->label_font) !=
strlen(dst->geom->label_font)) {
tmp = realloc(dst->geom->label_font,
- strlen(src->geom->label_font));
+ strlen(src->geom->label_font) + 1);
if (!tmp)
return FALSE;
dst->geom->label_font = tmp;
|