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

Fix panic when plugin responds with null volume #20682

Merged
merged 1 commit into from Feb 25, 2016

Conversation

cpuguy83
Copy link
Member

Please provide the following information:

  • What did you do?
    Fix panic when volume plugin returns a null response for Get requests
  • How did you do it?
    Check for a nil decoded volume.
  • How do I see it or verify it?
    See TestExternalVolumeDriverGetEmptyResponse
  • A picture of a cute animal (not mandatory but encouraged)

In cases where the a plugin responds with both a null or empty volume
and a null or empty Err, the daemon would panic.
This is because we assumed the idiom if err is nil, then v must not
be but in reality the plugin may return whatever it wants and we want to
make sure it doesn't harm the daemon.

Fixes #20952

In cases where the a plugin responds with both a null or empty volume
and a null or empty Err, the daemon would panic.
This is because we assumed the idiom if `err` is nil, then `v` must not
be but in reality the plugin may return whatever it wants and we want to
make sure it doesn't harm the daemon.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@thaJeztah
Copy link
Member

LGTM

@vdemeester
Copy link
Member

LGTM 🐿

vdemeester added a commit that referenced this pull request Feb 25, 2016
Fix panic when plugin responds with null volume
@vdemeester vdemeester merged commit 0ad0424 into moby:master Feb 25, 2016
@cpuguy83 cpuguy83 deleted the fix_volplugin_panics branch February 25, 2016 11:10
@tiborvass tiborvass mentioned this pull request Mar 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when volume plugin returns a null response for Get requests
4 participants