From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 00E833858D1E; Wed, 21 Dec 2022 12:15:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00E833858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671624929; bh=VB6U8GLafD4B0Ezqm24c683hyS73dgTjSZ890XC/jr0=; h=From:To:Subject:Date:From; b=ZwB3SEFmaXyQFx2gSq7bTA35J1GjnS79vHJGI6v6SCeKSB7Fe9izjskSE5Z3tphg7 jR7TMEl2Eu3NRiIPuc94t0W3esXs5dFiB/HcnsJECj7NWtyOJsKxqDDaBDCNiq1UHu S+Rycaa9WjrkPlbHECrG3srrllmD8H9V5tQfLg5g= 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: 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/master X-Git-Oldrev: 1b5fc91a1daa90fb955f57937f4590c5079dd161 X-Git-Newrev: 09cb4cd2940ff4c8b863cfa2fd2b043b8da0dca2 Message-Id: <20221221121529.00E833858D1E@sourceware.org> Date: Wed, 21 Dec 2022 12:15:29 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D09cb4cd2940= ff4c8b863cfa2fd2b043b8da0dca2 commit 09cb4cd2940ff4c8b863cfa2fd2b043b8da0dca2 Author: Corinna Vinschen AuthorDate: Wed Dec 21 13:08:39 2022 +0100 Commit: Corinna Vinschen CommitDate: Wed Dec 21 13:13:24 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 4df389bba257..eaf695b8182a 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