diff --git a/ext/dio/dio.c b/ext/dio/dio.c index 7f25bf17dfc..90ba912fc3d 100644 --- a/ext/dio/dio.c +++ b/ext/dio/dio.c @@ -188,7 +188,7 @@ PHP_FUNCTION(dio_read) RETURN_NULL(); } - data = erealloc(data, res); + data = erealloc(data, res + 1); data[res] = 0; RETURN_STRINGL(data, res, 0);