mirror of https://github.com/pwndbg/pwndbg
WIP: Fix Flake8 warnings (#2101)
* Fix F811 Signed-off-by: Chirag Aggarwal <thechiragaggarwal@outlook.com> * A003 doesn't flag anymore, rule was changed Signed-off-by: Chirag Aggarwal <thechiragaggarwal@outlook.com> * W505 Signed-off-by: Chirag Aggarwal <thechiragaggarwal@outlook.com> * Revert "W505" This reverts commit2494a34c20
. * Revert "A003 doesn't flag anymore, rule was changed" This reverts commitd342ac7aae
. * Removed a commented line Signed-off-by: Chirag Aggarwal <thechiragaggarwal@outlook.com> * Mistakenly modified another variable Signed-off-by: Chirag Aggarwal <thechiragaggarwal@outlook.com> * Replace not None assertion to not empty string Signed-off-by: Chirag Aggarwal <thechiragaggarwal@outlook.com> --------- Signed-off-by: Chirag Aggarwal <thechiragaggarwal@outlook.com>
This commit is contained in:
parent
6139d0b030
commit
ebcff7cd59
|
@ -1,7 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import cProfile
|
||||
import glob
|
||||
import locale
|
||||
import os
|
||||
import site
|
||||
|
|
|
@ -415,7 +415,6 @@ def map_inner(ei_class, ehdr, objfile: str) -> Tuple[pwndbg.lib.memory.Page, ...
|
|||
vaddr = int(phdr.p_vaddr)
|
||||
offset = int(phdr.p_offset)
|
||||
flags = int(phdr.p_flags)
|
||||
# ptype = int(phdr.p_type)
|
||||
|
||||
memsz += pwndbg.lib.memory.page_offset(vaddr)
|
||||
memsz = pwndbg.lib.memory.page_size_align(memsz)
|
||||
|
|
|
@ -11,7 +11,6 @@ ignore = [
|
|||
"E501",
|
||||
"E731",
|
||||
"F405",
|
||||
"F811",
|
||||
"F821",
|
||||
"W505",
|
||||
]
|
||||
|
|
|
@ -201,14 +201,6 @@ def test_try_free_corrupted_consolidate_backward(start_binary):
|
|||
os.remove(OUTPUT_FILE)
|
||||
|
||||
|
||||
def test_try_free_corrupted_consolidate_backward(start_binary):
|
||||
chunks = setup_heap(start_binary, 13)
|
||||
|
||||
result = gdb.execute(f"try_free {hex(chunks['e'])}", to_string=True)
|
||||
assert "corrupted size vs. prev_size while consolidating" in result
|
||||
os.remove(OUTPUT_FILE)
|
||||
|
||||
|
||||
@pytest.mark.skip(
|
||||
reason="Needs review. In the heap.py on the line 972 the condition is true always. The heap_bug.c file has the function: corrupted_unsorted_chunks()"
|
||||
)
|
||||
|
|
|
@ -11,13 +11,13 @@ def test_command_kbase():
|
|||
|
||||
def test_command_kchecksec():
|
||||
res = gdb.execute("kchecksec", to_string=True)
|
||||
assert res is not None # for F841 warning
|
||||
assert res != "" # for F841 warning
|
||||
# TODO: do something with res
|
||||
|
||||
|
||||
def test_command_kcmdline():
|
||||
res = gdb.execute("kcmdline", to_string=True)
|
||||
assert res is not None # for F841 warning
|
||||
assert res != "" # for F841 warning
|
||||
# TODO: do something with res
|
||||
|
||||
|
||||
|
|
|
@ -61,16 +61,6 @@ def test_nozero_flags():
|
|||
assert 0x0 == next(find_fastbin_size(buf, max_size, 8))
|
||||
|
||||
|
||||
def test_normal():
|
||||
max_size = 0x20
|
||||
offsets = {
|
||||
0x8: 0x20,
|
||||
}
|
||||
buf = setup_mem(max_size, offsets)
|
||||
assert 0x0 == next(find_fastbin_size(buf, max_size, 1))
|
||||
assert 0x0 == next(find_fastbin_size(buf, max_size, 8))
|
||||
|
||||
|
||||
def test_unaligned():
|
||||
max_size = 0x20
|
||||
offsets = {
|
||||
|
|
Loading…
Reference in New Issue