Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information