Hi Rakesh,

Rakesh Pandit wrote:
Hi Jean,

On 04/12/2016 03:10 PM, Jean-Pierre Andre wrote:
Hi Rakesh,

Rakesh Pandit wrote:
Hi,

On 04/12/2016 12:19 PM, Rakesh Pandit wrote:
Hi,

Attached patch fixes an annoying segmentation fault while running
ntfsrecover -f for investigation.

May it be reviewed ? Feel free to change and apply if suitable.

Thanks for the report.

Sounds good to me. On the cosmetic side, I would merge
into a single line for better readability and consistency
with the line which follows :

+                       system_page_size &
+                       (system_page_size - 1) ||

I will push with this change unless you object.

Please go ahead and push.


IMHO there is an error in your proposed patch, the
short-circuit should only be taken when the argument
is a log file (i.e. not a full partition or image).

The change :

                        ok = getvolumedata(ctx, boot.buf);
                }
-               if (!ok)
+               if (!ok) {
                        fclose(ctx->file);
+                       goto out;
+               }
        }
        if (!ok) {
                /* Not a log file, assume an ntfs device, mount it */

Should be :

                        ok = getvolumedata(ctx, boot.buf);
-               }
-               if (!ok)
+                       if (!ok) {
+                               fclose(ctx->file);
+                               goto out;
+                       }
+               } else {
                        fclose(ctx->file);
+               }
        }
        if (!ok) {
                /* Not a log file, assume an ntfs device, mount it */

Attached is the full fixed patch.

Regards

Jean-Pierre

Attachment: ntfsrecover.c.patch
Description: application/download

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to