From 7b9be58500fc055f9b6a0d7eaf3ed3e64a6ceea2 Mon Sep 17 00:00:00 2001 From: "K.Takata" Date: Mon, 4 Sep 2017 03:45:18 +0900 Subject: [PATCH] python2,3: Update iscygpty (#2836) Fix potential buffer overflow. --- mingw-w64-python2/2700-cygpty-isatty-disable-readline.patch | 4 ++-- mingw-w64-python2/PKGBUILD | 4 ++-- mingw-w64-python3/1700-cygpty-isatty-disable-readline.patch | 4 ++-- mingw-w64-python3/PKGBUILD | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mingw-w64-python2/2700-cygpty-isatty-disable-readline.patch b/mingw-w64-python2/2700-cygpty-isatty-disable-readline.patch index 6b51261643..6b3a224ed6 100644 --- a/mingw-w64-python2/2700-cygpty-isatty-disable-readline.patch +++ b/mingw-w64-python2/2700-cygpty-isatty-disable-readline.patch @@ -307,7 +307,7 @@ diff -Nur Python-2.7.13.orig/Python/iscygpty.c Python-2.7.13/Python/iscygpty.c + return 0; +#else + HANDLE h; -+ int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * MAX_PATH; ++ int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * (MAX_PATH - 1); + FILE_NAME_INFO *nameinfo; + WCHAR *p = NULL; + @@ -321,7 +321,7 @@ diff -Nur Python-2.7.13.orig/Python/iscygpty.c Python-2.7.13/Python/iscygpty.c + if (GetFileType(h) != FILE_TYPE_PIPE) { + return 0; + } -+ nameinfo = malloc(size); ++ nameinfo = malloc(size + sizeof(WCHAR)); + if (nameinfo == NULL) { + return 0; + } diff --git a/mingw-w64-python2/PKGBUILD b/mingw-w64-python2/PKGBUILD index a63feb2465..23862aedc9 100644 --- a/mingw-w64-python2/PKGBUILD +++ b/mingw-w64-python2/PKGBUILD @@ -6,7 +6,7 @@ _realname=python2 pkgbase="mingw-w64-${_realname}" pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=2.7.13 -pkgrel=2 +pkgrel=3 _pybasever=${pkgver%.*} pkgdesc="A high-level scripting language (mingw-w64)" arch=('any') @@ -455,4 +455,4 @@ sha256sums=('35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731' 'f1cfeb815277166384632bd9730fe89f64dc5da7ee09c13a0b3515da08b08847' 'be5379525508e0bc0c374f20a669c38c93986e24a07696d2a83a9552cc085b8d' 'aa623bd762f33f2724b40a55bd2d2c4100b47b81586ae2f5d6b430ab4646f02c' - 'c15b2b8140988af7ce1aa9f3f7465301f35de701b5fb7a6e51b17c950ec255d6') + '2f5044f0a61b5de400479d19cbc4e622f32a046f5eb360229793a4be76fe08fd') diff --git a/mingw-w64-python3/1700-cygpty-isatty-disable-readline.patch b/mingw-w64-python3/1700-cygpty-isatty-disable-readline.patch index 6bde0cb6b6..edaee6aa25 100644 --- a/mingw-w64-python3/1700-cygpty-isatty-disable-readline.patch +++ b/mingw-w64-python3/1700-cygpty-isatty-disable-readline.patch @@ -273,7 +273,7 @@ diff -Nur Python-3.6.2rc1/Python/iscygpty.c Python-3.6.2rc1_pty/Python/iscygpty. + return 0; +#else + HANDLE h; -+ int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * MAX_PATH; ++ int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * (MAX_PATH - 1); + FILE_NAME_INFO *nameinfo; + WCHAR *p = NULL; + @@ -287,7 +287,7 @@ diff -Nur Python-3.6.2rc1/Python/iscygpty.c Python-3.6.2rc1_pty/Python/iscygpty. + if (GetFileType(h) != FILE_TYPE_PIPE) { + return 0; + } -+ nameinfo = malloc(size); ++ nameinfo = malloc(size + sizeof(WCHAR)); + if (nameinfo == NULL) { + return 0; + } diff --git a/mingw-w64-python3/PKGBUILD b/mingw-w64-python3/PKGBUILD index 824954370c..782c84f4ab 100644 --- a/mingw-w64-python3/PKGBUILD +++ b/mingw-w64-python3/PKGBUILD @@ -18,7 +18,7 @@ pkgbase="mingw-w64-${_realname}" pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" _pybasever=3.6 pkgver=${_pybasever}.2 -pkgrel=2 +pkgrel=3 pkgdesc="A high-level scripting language (mingw-w64)" arch=('any') license=('PSF') @@ -492,5 +492,5 @@ sha256sums=('9229773be41ed144370f47f0f626a1579931f5a390f1e8e3853174d52edd64a9' '8896f4e11c17498c666251cef1c89ee0d78886814c8f227ee46807bedb4b1ad3' '597c1c13c7f4debea71de4de3325eeb66cb9c1dc064c4961a6f27de8f07c1992' '14347ddde0fb78ae9d7ae1674e24fbf8c26c5c75547de33633318d785468f49e' - 'cbd10a2b215cc698a187951f7647922d490da0f520f476f2d2c69e10a143bdaf' + '84abaae3cf6e578fea8526d9044099ad94ded4228c642e76aa3cd942bedbfd8f' 'f4f5359b35741b703cbd22dc73438c181b8541e30b3f7614bd272f7cd2c59049')