diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2020-04-11 11:30:44 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2020-04-11 11:34:11 +0300 |
commit | 22b71b87f619a3b95693be093bdfd1c1b624678f (patch) | |
tree | 328ff3d5e46ddeae7d461b284e430cfbc00244d1 /os_dep.c | |
parent | c29373ea17ebe7c22be4762b33f49f27383e9cca (diff) | |
download | bdwgc-22b71b87f619a3b95693be093bdfd1c1b624678f.tar.gz |
Eliminate 'passing tainted var maps_buf to tainted sink' code defect FP v2
(fix of commit c29373ea1)
* os_dep.c [NEED_PROC_MAPS && LINT2] (GC_get_maps): Pass value of
maps_buf to GC_noop1 (instead of BZERO) and do not pass maps_buf to
GC_scratch_recycle_no_gww.
Diffstat (limited to 'os_dep.c')
-rw-r--r-- | os_dep.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -201,10 +201,10 @@ GC_INNER char * GC_get_maps(void) while (maps_size >= maps_buf_sz) { # ifdef LINT2 /* Workaround passing tainted maps_buf to a tainted sink. */ - if (maps_buf != NULL) - BZERO(maps_buf, maps_buf_sz); + GC_noop1((word)maps_buf); +# else + GC_scratch_recycle_no_gww(maps_buf, maps_buf_sz); # endif - GC_scratch_recycle_no_gww(maps_buf, maps_buf_sz); /* Grow only by powers of 2, since we leak "too small" buffers.*/ while (maps_size >= maps_buf_sz) maps_buf_sz *= 2; maps_buf = GC_scratch_alloc(maps_buf_sz); |