Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing null check in WindowsSnapshot.Dispose #5190

Closed
2 tasks done
Jojo-1000 opened this issue May 14, 2024 · 1 comment · Fixed by #5193
Closed
2 tasks done

Missing null check in WindowsSnapshot.Dispose #5190

Jojo-1000 opened this issue May 14, 2024 · 1 comment · Fixed by #5193

Comments

@Jojo-1000
Copy link
Contributor

  • I have searched open and closed issues for duplicates.
  • I have searched the forum for related topics.

Environment info

  • Duplicati version: 4.0.8.
  • Operating system: Windows
  • Backend: -

Description

WindowsSnapshot.Dispose() calls Dispose on a variable that is null if the constructor failed.

Steps to reproduce

  1. Set snapshot policy to required
  2. Run backup without admin permissions
  • Actual result:
    Backup fails as expected, but verbose log shows cleanup error:
2024-05-14 18:29:20 +02 - [Verbose-Duplicati.Library.Snapshots.WindowsSnapshot-VSSCleanupOnError]: Failed during VSS error cleanup
System.NullReferenceException: Object reference not set to an instance of an object.
   at Duplicati.Library.Snapshots.WindowsSnapshot.Dispose(Boolean disposing) in Duplicati\Library\Snapshots\WindowsSnapshot.cs:line 324
   at Duplicati.Library.Snapshots.SnapshotBase.Dispose() in Duplicati\Library\Snapshots\SnapshotBase.cs:line 197
   at Duplicati.Library.Snapshots.WindowsSnapshot..ctor(IEnumerable`1 sources, IDictionary`2 options) in Duplicati\Library\Snapshots\WindowsSnapshot.cs:line 94
  • Expected result:
    The cleanup should succeed, because nothing needs to be done.
@kenkendk
Copy link
Member

Good find, it will be nice when #5166 is implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants