From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 96CCF3858425; Wed, 21 Dec 2022 12:15:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96CCF3858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671624953; bh=4EkBt+f8JReq+mEK8djnG8NvCI5T1GIn4Eb9mISobWw=; h=From:To:Subject:Date:From; b=JxLea7c310C/D7k8acPePMOuPDaviC5MYzNotbg9SUToyhn1A9KQdYYusk4xJgBe9 jj/z88BdaceXbF3UVSnA4vGPdJfW6TDCvjxGpB3AZKR8lZllwd8MQfZWZNMes9kz+i rxq8BNG0H7Bh/A/SqZdcZtXvy/tXUPpcsdEMkMvk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_4-branch] Cygwin: path_conv: make sure sym.path_flags is always initialized X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/cygwin-3_4-branch X-Git-Oldrev: 278033511e67a12dd3ecc5641e1d7e3dea76bf07 X-Git-Newrev: aad4a9484ad2cb2d3d496cf9ddd04c8cc4811935 Message-Id: <20221221121553.96CCF3858425@sourceware.org> Date: Wed, 21 Dec 2022 12:15:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Daad4a9484ad= 2cb2d3d496cf9ddd04c8cc4811935 commit aad4a9484ad2cb2d3d496cf9ddd04c8cc4811935 Author: Corinna Vinschen AuthorDate: Wed Dec 21 13:08:39 2022 +0100 Commit: Corinna Vinschen CommitDate: Wed Dec 21 13:13:59 2022 +0100 Cygwin: path_conv: make sure sym.path_flags is always initialized =20 Commit c1023ee353705 introduced a split between mount flags and path flags. It didn't initialize symlink_info::path_flags in path_conv::check, because that's done in symlink_info::check. =20 However, there are two code paths expecting symlink_info::path_flags being already initialized and both skip symlink_info::check. =20 Make sure symlink_info::path_flags is initalized to 0 early in path_conv::check. =20 Fixes: c1023ee353705 ("Cygwin: path_conv: decouple path_types from moun= t types") Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/path.cc | 2 +- winsup/cygwin/release/3.4.4 | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index c2ad39cb5394..97099af892d5 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -718,6 +718,7 @@ path_conv::check (const char *src, unsigned opt, /* FIXME: Do we have to worry about multiple \'s here? */ component =3D 0; // Number of translated components sym.contents[0] =3D '\0'; + sym.path_flags =3D 0; =20 int symlen =3D 0; =20 @@ -912,7 +913,6 @@ path_conv::check (const char *src, unsigned opt, { fileattr =3D 0; mount_flags =3D sym.mount_flags; - path_flags =3D sym.path_flags; if (component) { error =3D ENOTDIR; diff --git a/winsup/cygwin/release/3.4.4 b/winsup/cygwin/release/3.4.4 new file mode 100644 index 000000000000..6ac702375cca --- /dev/null +++ b/winsup/cygwin/release/3.4.4 @@ -0,0 +1,5 @@ +Bug Fixes +--------- + +- Fix an uninitialized variable having weird side-effects in path handling. + Addresses: https://cygwin.com/pipermail/cygwin/2022-December/252734.html