[Libguestfs] [PATCH nbdkit] DDRESCUE: MISC FIXES

Eric Blake eblake at redhat.com
Fri May 22 20:05:50 UTC 2020


On 5/22/20 2:53 PM, Richard W.M. Jones wrote:
> Use vector type to store map ranges.
> 
> Test filenames unique.
> 
> Remove some unused variables.
> 
> Break up long lines.
> ---

> @@ -95,7 +95,8 @@ parse_mapfile (const char *filename)
>         continue;
>       }
>   
> -    if (sscanf (line, "%" SCNi64 "\t%" SCNi64 "\t%c", &offset, &length, &status) == 3) {
> +    if (sscanf (line, "%" SCNi64 "\t%" SCNi64 "\t%c",
> +                &offset, &length, &status) == 3) {

sscanf() cannot detect integer overflow.  If you care about detecting 
overflow, you'll have to rewrite this into an open-coded loop using 
things like nbdkit_parse_size().

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




More information about the Libguestfs mailing list