delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/11/16/17:36:42

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4AGMagMD1904802
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4AGMagMD1904802
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=xF2w6007
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 544043857358
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1731796600;
bh=fcc1EZj91NMzeJ+wAcTVfnA7vlWKmyWHgTQQkJp0IOw=;
h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:From;
b=xF2w60077b3aze4mpG0SYA5juWb433Q4mXP4RGPbNVvIoU74j860U+cTZ+qaM4J21
viNsN+dod/BkFt6XJf1ioBplkODompbX3MciIRr6C/6QXUhR7mle4VzJtzhcxKLVdO
U+DbTYe8thIxFtVsfn6ylqJMzb6ssHOfv8kaoNog=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 299683857734
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 299683857734
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731796572; cv=none;
b=xu4gc/v8OoHWqC8q9drhg4CkyUK4etJ+C4+yD89F+HV1Kn8+OwJ0nKCALzkAKFIvMB8/4imwv5or8IQOhxAEC0BIwi5osIONY+5Z9iw6tAgEoCIO/bRdup4sfOoo7So6zLfyj1jMdNp4hHt9ppmj7VXtRcHnUJI3Cvbg4YtBIIQ=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1731796572; c=relaxed/simple;
bh=N2i7PhrGn9Ny1EB+P9ZozF1v2YaDySYfD5HEHj47bX8=;
h=DKIM-Signature:Message-ID:Date:MIME-Version:From:To:Subject;
b=CMJnoUnXhM6MNN8PE7CVVzEfyp5djXVPEG7cyFFbGTJXlNElR5hiW95PnArVrzsaPzLomZv9VQ941z5vKhQNEVts4I2ijLtu1lnZXWjCJxZfSE8xTOXYH49jiiLN4K1omefiwOQZs39BnoWvsIYWoYW79vBXIe0te3Zi6eXwLyU=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 299683857734
Message-ID: <9f95d44b-2a46-4da8-9177-fc9b60a6d18e@mailbox.org>
Date: Sat, 16 Nov 2024 23:36:06 +0100
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Possible issue with check_dir_not_empty
Autocrypt: addr=bernhardu AT mailbox DOT org; keydata=
xsBNBFLFOk0BCADSnIOyw5hwhDXc5yKipb7asfzYmBwgRL9NfM9W8fNz8G5iphXTX2cAvrMy
7CAOaktgz3yvWiJvf3l5GAB7FrA7HaY0sLRbhCcS06jvEAH3HScfaK+qPeJA1mHo11VudH5E
oaOUKNz6xy5Gb30SuISwVF+i30GeJNi3DTk8zGjqPQHEQiEo8CJ0Hc1r/fUgo+F9f1ugpZNG
Hn/ZJowpfCGRcNrrRC199MDI2m4q00i1bda8Z1P2PZTUZDWjD3dpzfkvVLSU+68Y49Kyv934
Qkj6LV/qw+4wnexWtgBCBTklz0ocVAN2wh/6VQ6ny3I3pJd9Phyd5qDmURZ08u8BZXEtABEB
AAHNK0Jlcm5oYXJkIMOcYmVsYWNrZXIgPGJlcm5oYXJkdUBtYWlsYm94Lm9yZz7CwJUEEwEK
AD8CGyMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAFiEE7HR0CmaRX6NuV4XV6W+iX4OmQeYF
AmUarOEFCRf5nZMACgkQ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ZZ
VadUH1G35w/XzlNEPerCul4mdCB/gaDvO4S6Fw7ceBvPy0MutKiJ2BdjD0kW02G3sLLmy8jY
Xun5X2+YmyYMtA==
X-MBO-RS-ID: 7cbe9aa104811aa7046
X-MBO-RS-META: aqgs3ep1ozcrwypi8fsz53tp5wzpoph7
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: =?utf-8?q?Bernhard_=C3=9Cbelacker_via_Cygwin?= <cygwin AT cygwin DOT com>
Reply-To: =?UTF-8?Q?Bernhard_=C3=9Cbelacker?= <bernhardu AT mailbox DOT org>
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

This is a multi-part message in MIME format.
--------------lKS0lL0R55DIjwDJg2kvXfps
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello everyone,

Is is about the buffer allocated in check_dir_not_empty.

The pointer pfni gets allocated the buffer at the begin,
and is used in the NtQueryDirectoryFile call before the loops.
In the loop the pointer pfni is also used as iterator.
Therefore it holds no longer the initial buffer at the call
to NtQueryDirectoryFile in the while conditition at the bottom.

Attached is a possible modification to always use the allocated buffer.

Kind regards,
Bernhard
--------------lKS0lL0R55DIjwDJg2kvXfps
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-Cygwin-check_dir_not_empty-Avoid-leaving-the-allocat.patch"
Content-Disposition: attachment;
 filename*0="0001-Cygwin-check_dir_not_empty-Avoid-leaving-the-allocat.pa";
 filename*1="tch"
Content-Transfer-Encoding: base64

RnJvbSA2NjdhOGQ1MjU4NzllZDFkMWFlODVjZmE4MWVhMzU2Nj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T1JNQVRJT04p
ICgoY2FkZHJfdCkgcGZuaSArIHBmbmktPk5leHRFbnRyeU9mZnNldCk7CisJICBwZm5pX2l0
ID0gKFBGSUxFX05BTUVTX0lORk9STUFUSU9OKSAoKGNhZGRyX3QpIHBmbmlfaXQgKyBwZm5p
X2l0LT5OZXh0RW50cnlPZmZzZXQpOwogCX0KICAgICB9CiAgIHdoaWxlIChOVF9TVUNDRVNT
IChOdFF1ZXJ5RGlyZWN0b3J5RmlsZSAoZGlyLCBOVUxMLCBOVUxMLCAwLCAmaW8sIHBmbmks
Ci0tIAoyLjM5LjIKCg==

--------------lKS0lL0R55DIjwDJg2kvXfps
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

--------------lKS0lL0R55DIjwDJg2kvXfps--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019