From e9a2a67745d46509928263f0556f5c0a4211b94f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 5 May 2008 15:45:15 -0700 Subject: [PATCH] GEM: Allocate the right number of relocs, avoiding heap smashing. --- src/mesa/drivers/dri/intel/intel_bufmgr_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.30.2