Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_syscall_ftruncate(ql, ftrunc_fd, ftrunc_length, *args):
target = False
pathname = ql.file_des[ftrunc_fd].name.split('/')[-1]
if pathname == "test_syscall_ftruncate.txt":
print("test => ftruncate(%d, 0x%x)" % (ftrunc_fd, ftrunc_length))
target = True
syscall.ql_syscall_ftruncate(ql, ftrunc_fd, ftrunc_length, *args)
if target:
real_path = ql_transform_to_real_path(ql, pathname)
assert os.stat(real_path).st_size == 0x10
os.remove(real_path)