[OpenSmalltalk/opensmalltalk-vm] primitiveDirectoryLookup NULL access on Windows (#372)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] primitiveDirectoryLookup NULL access on Windows (#372)

David T Lewis
 

The following code crashes the VM:

i:=0.
[ FileDirectory new primLookupEntryIn: 'C:' index: i] whileNotNil: [ i:= i+1].
FileDirectory new primLookupEntryIn: 'C:' index: i+1

The reason is that the dirCacheHit path in sqWin32Directory.c is taken and FindNextFileW is called with findHandle == NULL.

Additionally, primLookupEntryIn accepts negative indices, which means this works but probably should not:

FileDirectory new primLookupEntryIn: 'C:' index: -1.
FileDirectory new primLookupEntryIn: 'C:' index: 0.
(FileDirectory new primLookupEntryIn: 'C:' index: 1) ~~(FileDirectory new primLookupEntryIn: 'C:' index: 1) "= true" 


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"primitiveDirectoryLookup NULL access on Windows (#372)"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/372"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/372", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/372", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>