- Update to version 1.7.2

* bug fix release, correcting a regression introduced by and
    improving the checks from the fix for CVE-2021-31535.
- supersedes U_Check-for-NULL-strings-before-getting-their-lengths.patch

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libX11?expand=0&rev=69
This commit is contained in:
Stefan Dirsch 2021-06-06 19:06:20 +00:00 committed by Git OBS Bridge
parent 2338e9595a
commit 705c2b7d98
6 changed files with 13 additions and 167 deletions

View File

@ -1,160 +0,0 @@
From ab2f59530b16bdfbf023b8e025c7c8aba3b6fd0c Mon Sep 17 00:00:00 2001
From: Matthieu Herrb <matthieu@herrb.eu>
Date: Sun, 30 May 2021 16:33:48 +0200
Subject: [PATCH] Check for NULL strings before getting their lengths
Problem reported by Karsten Trulsen
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
---
src/Font.c | 2 +-
src/FontInfo.c | 2 +-
src/FontNames.c | 2 +-
src/GetColor.c | 2 +-
src/LoadFont.c | 2 +-
src/LookupCol.c | 2 ++
src/ParseCol.c | 2 +-
src/QuExt.c | 2 +-
src/StNColor.c | 2 +-
src/StName.c | 4 ++--
10 files changed, 12 insertions(+), 10 deletions(-)
Index: libX11-1.7.1/src/Font.c
===================================================================
--- libX11-1.7.1.orig/src/Font.c
+++ libX11-1.7.1/src/Font.c
@@ -102,7 +102,7 @@ XFontStruct *XLoadQueryFont(
XF86BigfontCodes *extcodes = _XF86BigfontCodes(dpy);
#endif
- if (strlen(name) >= USHRT_MAX)
+ if (name != NULL && strlen(name) >= USHRT_MAX)
return NULL;
if (_XF86LoadQueryLocaleFont(dpy, name, &font_result, (Font *)0))
return font_result;
Index: libX11-1.7.1/src/FontInfo.c
===================================================================
--- libX11-1.7.1.orig/src/FontInfo.c
+++ libX11-1.7.1/src/FontInfo.c
@@ -58,7 +58,7 @@ XFontStruct **info) /* RETURN */
register xListFontsReq *req;
int j;
- if (strlen(pattern) >= USHRT_MAX)
+ if (pattern != NULL && strlen(pattern) >= USHRT_MAX)
return NULL;
LockDisplay(dpy);
Index: libX11-1.7.1/src/FontNames.c
===================================================================
--- libX11-1.7.1.orig/src/FontNames.c
+++ libX11-1.7.1/src/FontNames.c
@@ -51,7 +51,7 @@ int *actualCount) /* RETURN */
register xListFontsReq *req;
unsigned long rlen = 0;
- if (strlen(pattern) >= USHRT_MAX)
+ if (pattern != NULL && strlen(pattern) >= USHRT_MAX)
return NULL;
LockDisplay(dpy);
Index: libX11-1.7.1/src/GetColor.c
===================================================================
--- libX11-1.7.1.orig/src/GetColor.c
+++ libX11-1.7.1/src/GetColor.c
@@ -49,7 +49,7 @@ XColor *exact_def) /* RETURN */
XcmsColor cmsColor_exact;
Status ret;
- if (strlen(colorname) >= USHRT_MAX)
+ if (colorname != NULL && strlen(colorname) >= USHRT_MAX)
return (0);
#ifdef XCMS
Index: libX11-1.7.1/src/LoadFont.c
===================================================================
--- libX11-1.7.1.orig/src/LoadFont.c
+++ libX11-1.7.1/src/LoadFont.c
@@ -39,7 +39,7 @@ XLoadFont (
Font fid;
register xOpenFontReq *req;
- if (strlen(name) >= USHRT_MAX)
+ if (name != NULL && strlen(name) >= USHRT_MAX)
return (0);
if (_XF86LoadQueryLocaleFont(dpy, name, (XFontStruct **)0, &fid))
Index: libX11-1.7.1/src/LookupCol.c
===================================================================
--- libX11-1.7.1.orig/src/LookupCol.c
+++ libX11-1.7.1/src/LookupCol.c
@@ -47,6 +47,8 @@ XLookupColor (
XcmsCCC ccc;
XcmsColor cmsColor_exact;
+ if (spec == NULL)
+ return 0;
n = (int) strlen (spec);
if (n >= USHRT_MAX)
return 0;
Index: libX11-1.7.1/src/ParseCol.c
===================================================================
--- libX11-1.7.1.orig/src/ParseCol.c
+++ libX11-1.7.1/src/ParseCol.c
@@ -46,7 +46,7 @@ XParseColor (
XcmsCCC ccc;
XcmsColor cmsColor;
- if (!spec) return(0);
+ if (!spec) return(0);
n = (int) strlen (spec);
if (n >= USHRT_MAX)
return(0);
Index: libX11-1.7.1/src/QuExt.c
===================================================================
--- libX11-1.7.1.orig/src/QuExt.c
+++ libX11-1.7.1/src/QuExt.c
@@ -42,7 +42,7 @@ XQueryExtension(
xQueryExtensionReply rep;
register xQueryExtensionReq *req;
- if (strlen(name) >= USHRT_MAX)
+ if (name != NULL && strlen(name) >= USHRT_MAX)
return false;
if (name && strlen (name) < 256)
Index: libX11-1.7.1/src/StNColor.c
===================================================================
--- libX11-1.7.1.orig/src/StNColor.c
+++ libX11-1.7.1/src/StNColor.c
@@ -47,7 +47,7 @@ int flags) /* DoRed, DoGreen, DoBlue */
XcmsColor cmsColor_exact;
XColor scr_def;
- if (strlen(name) >= USHRT_MAX)
+ if (name != NULL && strlen(name) >= USHRT_MAX)
return 0;
#ifdef XCMS
/*
Index: libX11-1.7.1/src/StName.c
===================================================================
--- libX11-1.7.1.orig/src/StName.c
+++ libX11-1.7.1/src/StName.c
@@ -37,7 +37,7 @@ XStoreName (
Window w,
_Xconst char *name)
{
- if (strlen(name) >= USHRT_MAX)
+ if (name != NULL && strlen(name) >= USHRT_MAX)
return 0;
return XChangeProperty(dpy, w, XA_WM_NAME, XA_STRING, /* */
8, PropModeReplace, (_Xconst unsigned char *)name,
@@ -50,7 +50,7 @@ XSetIconName (
Window w,
_Xconst char *icon_name)
{
- if (strlen(icon_name) >= USHRT_MAX)
+ if (icon_name != NULL && strlen(icon_name) >= USHRT_MAX)
return 0;
return XChangeProperty(dpy, w, XA_WM_ICON_NAME, XA_STRING, 8,
PropModeReplace, (_Xconst unsigned char *)icon_name,

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e64e43deaa562cbfb0d5ada64670ec09c6fac7935262dcd77bbc6d984a535d47
size 2426509

3
libX11-1.7.2.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1cfa35e37aaabbe4792e9bb690468efefbfbf6b147d9c69d6f90d13c3092ea6c
size 2392982

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Sun Jun 6 18:54:32 UTC 2021 - Stefan Dirsch <sndirsch@suse.com>
- Update to version 1.7.2
* bug fix release, correcting a regression introduced by and
improving the checks from the fix for CVE-2021-31535.
- supersedes U_Check-for-NULL-strings-before-getting-their-lengths.patch
-------------------------------------------------------------------
Mon May 31 15:33:38 UTC 2021 - Stefan Dirsch <sndirsch@suse.com>

View File

@ -17,7 +17,7 @@
Name: libX11
Version: 1.7.1
Version: 1.7.2
Release: 0
Summary: Core X11 protocol client library
License: MIT
@ -33,7 +33,6 @@ Patch0: p_khmer-compose.diff
Patch1: p_xlib_skip_ext_env.diff
# PATCH-FIX-UPSTREAM en-locales.diff fdo#48596 bnc#388711 -- Add missing data for more en locales
Patch2: en-locales.diff
Patch3: U_Check-for-NULL-strings-before-getting-their-lengths.patch
BuildRequires: fdupes
BuildRequires: libtool
@ -138,7 +137,6 @@ test -f nls/ja.S90/XLC_LOCALE.pre && exit 1
%patch0
%patch1
%patch2
%patch3 -p1
%build
%configure \

View File

@ -3,7 +3,7 @@ Index: src/QuExt.c
--- src/QuExt.c.orig
+++ src/QuExt.c
@@ -45,6 +45,20 @@ XQueryExtension(
if (strlen(name) >= USHRT_MAX)
if (name != NULL && strlen(name) >= USHRT_MAX)
return false;
+ if (name && strlen (name) < 256)