summaryrefslogtreecommitdiff
path: root/lib/libX11/modules
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2022-02-21 08:01:25 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2022-02-21 08:01:25 +0000
commit3d9d1e605f01f25d680f28a03713ab031dc7c46e (patch)
tree3799a3516aefe2074c84243c932f20a5faea8e8d /lib/libX11/modules
parentc259179a37a495b4e22c6787185a50171358d838 (diff)
Update to libX11 1.7.3.1. ok jsg@ who noticed this requires a major bump.
Diffstat (limited to 'lib/libX11/modules')
-rw-r--r--lib/libX11/modules/im/ximcp/imLcPrs.c4
-rw-r--r--lib/libX11/modules/om/generic/omTextEsc.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/libX11/modules/im/ximcp/imLcPrs.c b/lib/libX11/modules/im/ximcp/imLcPrs.c
index 60215c706..795ea7191 100644
--- a/lib/libX11/modules/im/ximcp/imLcPrs.c
+++ b/lib/libX11/modules/im/ximcp/imLcPrs.c
@@ -676,8 +676,10 @@ parseline(
goto error;
b->tree = new;
b->treesize = newsize;
+ /* Re-derive top after realloc() to avoid undefined behaviour
+ (and crashes on architectures that track pointer bounds). */
if (top >= (DTIndex *) old && top < (DTIndex *) &old[oldsize])
- top = (DTIndex *) (((char *) top) + (((char *)b->tree)-(char *)old));
+ top = (DTIndex *) (((char *)new) + (((char *)top)-(char *)old));
}
p = &b->tree[b->treeused];
p->keysym = buf[i].keysym;
diff --git a/lib/libX11/modules/om/generic/omTextEsc.c b/lib/libX11/modules/om/generic/omTextEsc.c
index df1fb10c0..2aaff73db 100644
--- a/lib/libX11/modules/om/generic/omTextEsc.c
+++ b/lib/libX11/modules/om/generic/omTextEsc.c
@@ -169,10 +169,10 @@ TextWidthWithFontSet(
*
*/
- if(fd == (FontData) NULL ||
- (font = font_set->font) == (XFontStruct *) NULL) {
+ if((font = font_set->font) == (XFontStruct *) NULL) {
- if((font = fd->font) == (XFontStruct *) NULL)
+ if(fd == (FontData) NULL ||
+ (font = fd->font) == (XFontStruct *) NULL)
break;
}