Hi,
Chih-Wei Huang wrote 2014-04-15 10.33:
I'm trying to fix the compiling warnings of ntfs-3g and
then found a possible leak in ntfs_fuse_parse_path of ntfs-3g.c.
If I read the code correctly, in ntfs_fuse_parse_path(), it's possible
that strdup() succeeds but ntfs_mbstoucs() returns a negative value.
In such a case the callers just treat it as an error and ignores the
allocated path buffer that results in a memory leak.
I suggest the attached patch to fix it, as well as some warnings.
Let me know if it's the correct way to handle it.
It looks like you are reading the code correctly, however the patch also
includes changes outside of ntfs_fuse_parse_path that are not described
by the commit message and appear to be unrelated.
Please take these out and attach a separate patch describing these
changes (I assume they are meant to fix compiler warnings).
Best regards,
- Erik
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel