Skip to content

Commit c2efb24

Browse files
authored
Merge pull request #1586 from rliebig/dev-liebig-syscall-read-eisdir
return EISDIR in case ql_syscall_read is attempted on directory
2 parents f309c87 + 313b907 commit c2efb24

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)