afnarqui / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

NULL dereference #122

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm unable to reproduce this consistently. It keeps happening after I've
done some debugging and let it continue to run.

This is on 32bit XP sp2.

What is happening is in dokan\directory.c the function MatchFiles is
getting a NULL FindDataList, which it doesn't check before using.

Quick fix is of course just to check FindDataList before using it and not
use it if it's NULL.

Seams to work for me anyway. ;-)

Joe

Original issue reported on code.google.com by joe.a.bu...@gmail.com on 9 Dec 2009 at 10:45

GoogleCodeExporter commented 9 years ago
Found another: \dokan\list.h  : function IsListEmpty  also doesn't deal with a 
NULL
LIST_ENTRY argument. This again is happening after debugging. As it doesn't cost
anything worth worrying about to protect against NULL in these functions, I 
would
argue it's worth putting NULL protect in.

Original comment by joe.a.bu...@gmail.com on 10 Dec 2009 at 11:16

GoogleCodeExporter commented 9 years ago
Also NULL protected RemoveEntryList, RemoveHeadList and RemoveTailList to avoid 
any
post debugging clean up crashes.

Original comment by joe.a.bu...@gmail.com on 16 Dec 2009 at 2:25

GoogleCodeExporter commented 9 years ago
I added NULL checking in IsEmptyList and RemoveEntryList. Other functions are 
used 
inside !IsEmptyList loop and those codes assume that those functions return a 
valid 
pointer, so I leave them as they are.

Original comment by asa...@gmail.com on 24 Dec 2009 at 9:35