mesa/src
Carl Worth c35f14f368 Eliminate several cases of multiplication in arguments to calloc
In commit 32f2fd1c5d, several calls to
_mesa_calloc(x) were replaced with calls to calloc(1, x). This is strictly
equivalent to what the code was doing previously.

But for cases where "x" involves multiplication, now that we are explicitly
using the two-argument calloc, we can do one step better and replace:

	calloc(1, A * B);

with:

	calloc(A, B);

The advantage of the latter is that calloc will detect any overflow that would
have resulted from the multiplication and will fail the allocation, (whereas
the former would return a small allocation). So this fix can change
potentially exploitable buffer overruns into segmentation faults.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-03 18:37:02 -07:00
..
egl egl/dri2: use the correct screen index 2014-09-01 20:09:19 +02:00
gallium Eliminate several cases of multiplication in arguments to calloc 2014-09-03 18:37:02 -07:00
gbm gbm: Log at least one dlerror() when we fail to open any drivers. 2014-07-30 22:31:30 -07:00
getopt
glsl glsl: Report progress from opt_copy_propagation_elements(). 2014-09-03 17:26:06 -07:00
glx include: move sarea.h next to it's only user 2014-08-21 21:47:37 +01:00
gtest gtest: Update to 1.7.0. 2014-04-14 00:06:53 -07:00
hgl gallium/targets: Break haiku state_tracker out to own directory 2014-08-28 21:27:29 -04:00
loader android: loader: prefix static libraries with libmesa_* 2014-08-13 00:46:57 +01:00
mapi Eliminate several cases of multiplication in arguments to calloc 2014-09-03 18:37:02 -07:00
mesa Eliminate several cases of multiplication in arguments to calloc 2014-09-03 18:37:02 -07:00
util util: remove ralloc_test 2014-08-08 19:23:25 +01:00
Makefile.am automake: handle gallium SUBDIRs in gallium/Makefile 2014-08-13 00:46:54 +01:00
SConscript util: Move ralloc to a new src/util directory. 2014-08-04 11:06:58 -07:00