浏览代码

Fix: String is not zero-terminatedpage

viest 3 年之前
父节点
当前提交
4faf34e225
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      kernel/help.c

+ 1 - 0
kernel/help.c

@@ -38,6 +38,7 @@ zend_long date_double_to_timestamp(double value) {
     }
     smart_str_append_long(&_modify_arg_string, days);
     smart_str_appendl(&_modify_arg_string, " days", 5);
+    ZSTR_VAL(_modify_arg_string.s)[ZSTR_LEN(_modify_arg_string.s)] = '\0';
     ZVAL_STR(&_modify_args[0], _modify_arg_string.s);
     call_object_method(&datetime, "modify", 1, _modify_args, &_modify_result);
     zval_ptr_dtor(&datetime);