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

rbd: trigger an error on invalid max snaps value #977

Merged
merged 1 commit into from
Apr 5, 2024

Commits on Apr 5, 2024

  1. rbd: trigger an error on invalid max snaps value

    In file include from rbd.go:931
    var cMaxSnaps C.int
    ret := C.rbd_snap_list(image.image, nil, &cMaxSnaps)
    cSnaps := make([]C.rbd_snap_info_t, cMaxSnaps)
    It is necessary to determine whether cMaxSnaps is a large 0. Otherwise, the following code will panic
    ret = C.rbd_snap_list(image.image,&cSnaps[0], &cMaxSnaps)
    
    Signed-off-by: zxysilent <zxysilent@outlook.com>
    zxysilent authored and phlogistonjohn committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    f408405 View commit details
    Browse the repository at this point in the history