[PATCH] fuzz: fix wrong index in clear_bits

Qiuhao Li posted 1 patch 3 years, 3 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/SYCPR01MB3502E9F6EB06DEDCD484F738FCBA9@SYCPR01MB3502.ausprd01.prod.outlook.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, Stefan Hajnoczi <stefanha@redhat.com>, Bandan Das <bsd@redhat.com>, Thomas Huth <thuth@redhat.com>
scripts/oss-fuzz/minimize_qtest_trace.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] fuzz: fix wrong index in clear_bits
Posted by Qiuhao Li 3 years, 3 months ago
Signed-off-by: Qiuhao Li <Qiuhao.Li@outlook.com>
---
 scripts/oss-fuzz/minimize_qtest_trace.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/oss-fuzz/minimize_qtest_trace.py b/scripts/oss-fuzz/minimize_qtest_trace.py
index 4cba96dee2..20825768c2 100755
--- a/scripts/oss-fuzz/minimize_qtest_trace.py
+++ b/scripts/oss-fuzz/minimize_qtest_trace.py
@@ -261,7 +261,7 @@ def clear_bits(newtrace, outpath):
                 data_try = hex(int("".join(data_bin_list), 2))
                 # It seems qtest only accepts padded hex-values.
                 if len(data_try) % 2 == 1:
-                    data_try = data_try[:2] + "0" + data_try[2:-1]
+                    data_try = data_try[:2] + "0" + data_try[2:]
 
                 newtrace[i] = "{prefix} {data_try}\n".format(
                         prefix=prefix,
-- 
2.25.1


Re: [PATCH] fuzz: fix wrong index in clear_bits
Posted by Paolo Bonzini 3 years, 3 months ago
On 28/01/21 04:59, Qiuhao Li wrote:
> Signed-off-by: Qiuhao Li <Qiuhao.Li@outlook.com>
> ---
>   scripts/oss-fuzz/minimize_qtest_trace.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/oss-fuzz/minimize_qtest_trace.py b/scripts/oss-fuzz/minimize_qtest_trace.py
> index 4cba96dee2..20825768c2 100755
> --- a/scripts/oss-fuzz/minimize_qtest_trace.py
> +++ b/scripts/oss-fuzz/minimize_qtest_trace.py
> @@ -261,7 +261,7 @@ def clear_bits(newtrace, outpath):
>                   data_try = hex(int("".join(data_bin_list), 2))
>                   # It seems qtest only accepts padded hex-values.
>                   if len(data_try) % 2 == 1:
> -                    data_try = data_try[:2] + "0" + data_try[2:-1]
> +                    data_try = data_try[:2] + "0" + data_try[2:]
>   
>                   newtrace[i] = "{prefix} {data_try}\n".format(
>                           prefix=prefix,
> 

Queued, thanks.

Paolo