Browse Source

emalloc() -> safe_emalloc()

experimental/5.2-WITH_DRCP
Ilia Alshanetsky 20 years ago
parent
commit
17864fc3e9
  1. 6
      ext/exif/exif.c

6
ext/exif/exif.c

@ -1606,7 +1606,7 @@ static int exif_file_sections_add(image_info_type *ImageInfo, int type, size_t s
if (!size) {
data = NULL;
} else if (data == NULL) {
data = emalloc(size);
data = safe_emalloc(size, 1, 0);
}
ImageInfo->file.list[count].type = type;
ImageInfo->file.list[count].data = data;
@ -2383,7 +2383,7 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
image_info_value *info_value;
byte_count = php_tiff_bytes_per_format[info_data->format] * info_data->length;
value_ptr = emalloc(max(byte_count, 4));
value_ptr = safe_emalloc(max(byte_count, 4), 1, 0);
memset(value_ptr, 0, 4);
if (!info_data->length) {
return value_ptr;
@ -2875,7 +2875,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
}
if (byte_count>sizeof(cbuf)) {
/* mark as outside range and get buffer */
value_ptr = emalloc(byte_count);
value_ptr = safe_emalloc(byte_count, 1, 0);
outside = value_ptr;
} else {
/*

Loading…
Cancel
Save