8000 fix segfault · jrtkcoder/phpredis@0126481 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0126481

Browse files
committed
fix segfault
1 parent ea98401 commit 0126481

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ PHP_REDIS_API int redis_sock_get(zval *id, RedisSock **redis_sock TSRMLS_DC,
430430
zval *socket;
431431

432432
if (Z_TYPE_P(id) != IS_OBJECT || (socket = zend_hash_str_find(Z_OBJPROP_P(id), "socket",
433-
sizeof("socket") - 1)) == NULL) {
433+
sizeof("socket") - 1)) == NULL || Z_RES_P(socket) == NULL) {
434434
// Throw an exception unless we've been requested not to
435435
if(!no_throw) {
436436
zend_throw_exception(redis_exception_ce, "Redis server went away",

0 commit comments

Comments
 (0)
0