mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxl: Cleanup: use libxl__backendpath_parse_domid in libxl__device_disk_from_xs_be
Rather than an open-coded sscanf. No functional change with correct input. This is a followup to XSA-175 and XSA-178. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com> Release-acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
624c862176
commit
03273df2ec
1 file changed
+3
-3
+3
-3
@@ -2658,10 +2658,10 @@ static int libxl__device_disk_from_xenstore(libxl__gc *gc,
|
||||
goto out;
|
||||
}
|
||||
|
||||
rc = sscanf(backend_path, "/local/domain/%d/", &disk->backend_domid);
|
||||
if (rc != 1) {
|
||||
rc = libxl__backendpath_parse_domid(gc, backend_path, &disk->backend_domid);
|
||||
if (rc) {
|
||||
LOG(ERROR, "Unable to fetch device backend domid from %s", backend_path);
|
||||
goto cleanup;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||