Skip to content

Commit 313b907

Browse files
committed
return EISDIR in case ql_file object has a directory path and a read syscall is attempted on it
1 parent 2f604f4 commit 313b907

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

qiling/os/posix/syscall/unistd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,8 @@ def ql_syscall_read(ql: Qiling, fd: int, buf: int, length: int):
415415

416416
try:
417417
data = f.read(length)
418+
except IsADirectoryError:
419+
return -EISDIR
418420
except ConnectionError:
419421
ql.log.debug('read failed due to a connection error')
420422
return -EIO

0 commit comments

Comments
 (0)