From: Eric Anholt Date: Mon, 5 May 2008 22:45:15 +0000 (-0700) Subject: GEM: Allocate the right number of relocs, avoiding heap smashing. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e9a2a67745d46509928263f0556f5c0a4211b94f;p=mesa.git GEM: Allocate the right number of relocs, avoiding heap smashing. --- diff --git a/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c b/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c index 6f0ecfbdb86..e4e8481b962 100644 --- a/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c +++ b/src/mesa/drivers/dri/intel/intel_bufmgr_gem.c @@ -247,7 +247,7 @@ intel_setup_reloc_list(dri_bo *bo) bo_gem->relocs = calloc(bufmgr_gem->max_relocs, sizeof(struct drm_i915_gem_relocation_entry)); - bo_gem->reloc_target_bo = calloc(1, sizeof(dri_bo *)); + bo_gem->reloc_target_bo = calloc(bufmgr_gem->max_relocs, sizeof(dri_bo *)); return 0; }