add NULL check

This commit is contained in:
Anatol Belski 2015-07-25 20:05:58 +02:00
parent d73287be18
commit c18f5e1edd

View file

@ -244,9 +244,12 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
return NULL;
}
data.buf = emalloc(data.len + 1);
memcpy(data.buf, bufptr, data.len);
data.buf[data.len] = 0;
data.buf = NULL;
if (data.len > 0) {
data.buf = emalloc(data.len + 1);
memcpy(data.buf, bufptr, data.len);
data.buf[data.len] = 0;
}
data.filename = filename;
data.line[0] = 0;