Skip to content

Commit 40c76b2

Browse files
committed
Fix fseek undefined behavior
1 parent 69b4e6d commit 40c76b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main/streams/memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static int php_stream_memory_seek(php_stream *stream, zend_off_t offset, int whe
128128
switch(whence) {
129129
case SEEK_CUR:
130130
if (offset < 0) {
131-
if (ms->fpos < -(size_t)offset) {
131+
if (ms->fpos < (size_t)(-offset)) {
132132
ms->fpos = 0;
133133
*newoffs = -1;
134134
return -1;

0 commit comments

Comments
 (0)