[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/10] image-fuzzer: Encode file name and file format to bytes
From: |
Eduardo Habkost |
Subject: |
[PATCH 08/10] image-fuzzer: Encode file name and file format to bytes |
Date: |
Wed, 16 Oct 2019 16:24:28 -0300 |
Callers of create_image() will pass strings as arguments, but the
Image class will expect bytes objects to be provided. Encode
them inside create_image().
Signed-off-by: Eduardo Habkost <address@hidden>
---
tests/image-fuzzer/qcow2/layout.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/image-fuzzer/qcow2/layout.py
b/tests/image-fuzzer/qcow2/layout.py
index a0fd53c7ad..01bff4d05e 100644
--- a/tests/image-fuzzer/qcow2/layout.py
+++ b/tests/image-fuzzer/qcow2/layout.py
@@ -602,8 +602,8 @@ class Image(object):
def create_image(test_img_path, backing_file_name=None, backing_file_fmt=None,
fields_to_fuzz=None):
"""Create a fuzzed image and write it to the specified file."""
- image = Image(backing_file_name)
- image.set_backing_file_format(backing_file_fmt)
+ image = Image(backing_file_name.encode())
+ image.set_backing_file_format(backing_file_fmt.encode())
image.create_feature_name_table()
image.set_end_of_extension_area()
image.create_l_structures()
--
2.21.0
- Re: [PATCH 02/10] image-fuzzer: Write bytes instead of string to image file, (continued)
- [PATCH 01/10] image-fuzzer: Open image files in binary mode, Eduardo Habkost, 2019/10/16
- [PATCH 03/10] image-fuzzer: Explicitly use integer division operator, Eduardo Habkost, 2019/10/16
- [PATCH 04/10] image-fuzzer: Use io.StringIO, Eduardo Habkost, 2019/10/16
- [PATCH 05/10] image-fuzzer: Use %r for all fiels at Field.__repr__(), Eduardo Habkost, 2019/10/16
- [PATCH 06/10] image-fuzzer: Return bytes objects on string fuzzing functions, Eduardo Habkost, 2019/10/16
- [PATCH 07/10] image-fuzzer: Use bytes constant for field values, Eduardo Habkost, 2019/10/16
- [PATCH 08/10] image-fuzzer: Encode file name and file format to bytes,
Eduardo Habkost <=
- [PATCH 09/10] image-fuzzer: Run using python3, Eduardo Habkost, 2019/10/16
- [PATCH 10/10] image-fuzzer: Use errors parameter of subprocess.Popen(), Eduardo Habkost, 2019/10/16
- Re: [PATCH 00/10] image-fuzzer: Port to Python 3, John Snow, 2019/10/17