Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion rarentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ void _rar_entry_to_zval(zval *parent,
char *filename;
int filename_size,
filename_len;
#if PHP_MAJOR_VERSION >= 7
zend_long unp_size; /* zval stores PHP ints as zend_long, so use that here */
#else
long unp_size; /* zval stores PHP ints as long, so use that here */
#endif
zval *parent_copy = parent;
#if PHP_MAJOR_VERSION < 7
/* allocate zval on the heap */
Expand All @@ -85,7 +89,9 @@ void _rar_entry_to_zval(zval *parent,
zend_update_property(rar_class_entry_ptr, obj, "rarfile",
sizeof("rararch") - 1, parent_copy TSRMLS_CC);

#if ULONG_MAX > 0xffffffffUL
#if PHP_MAJOR_VERSION >= 7 && ZEND_ENABLE_ZVAL_LONG64
unp_size = ((zend_long) entry->UnpSize) + (((zend_long) entry->UnpSizeHigh) << 32);
#elif PHP_MAJOR_VERSION < 7 && ULONG_MAX > 0xffffffffUL
unp_size = ((long) entry->UnpSize) + (((long) entry->UnpSizeHigh) << 32);
#else
/* for 32-bit long, at least don't give negative values */
Expand Down