diff mbox series

fuzz: fix wrong index in clear_bits

Message ID SYCPR01MB3502E9F6EB06DEDCD484F738FCBA9@SYCPR01MB3502.ausprd01.prod.outlook.com (mailing list archive)
State New, archived
Headers show
Series fuzz: fix wrong index in clear_bits | expand

Commit Message

Qiuhao Li Jan. 28, 2021, 3:59 a.m. UTC
Signed-off-by: Qiuhao Li <Qiuhao.Li@outlook.com>
---
 scripts/oss-fuzz/minimize_qtest_trace.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Jan. 28, 2021, 8:17 a.m. UTC | #1
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
diff mbox series

Patch

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,