Skip to content

Commit 4d4fdd3

Browse files
committed
Merge pull request #37 from remicollet/issue-0310
fix segfault in sundown_render_base
2 parents 31ce163 + 9f2d92a commit 4d4fdd3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

php_sundown.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int call_user_function_v(HashTable *function_table, zval **object_pp, zva
163163
TSRMLS_FETCH();
164164

165165
if (param_count > 0) {
166-
params = emalloc(sizeof(zval**) * param_count);
166+
params = emalloc(sizeof(zval*) * param_count);
167167
va_start(ap, param_count);
168168
for (i=0; i<param_count;i++) {
169169
params[i] = va_arg(ap, zval*);

render_base.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ PHP_METHOD(sundown_render_base, blockHtml)
227227
PHP_METHOD(sundown_render_base, header)
228228
{
229229
char *htext;
230-
int htext_len, header_level;
230+
int htext_len;
231+
long header_level;
231232

232233
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
233234
"sl", &htext, &htext_len, &header_level) == FAILURE) {

0 commit comments

Comments
 (0)