Blender Git Loki

Git Commits -> Revision 41f2ea4

Revision 41f2ea4 by Campbell Barton (master)
May 27, 2021, 07:59 (GMT)
Fix incorrect BLI_snprintf usage

Event though in practice this wasn't causing problems as the fixed size
buffers are generally large enough not to truncate text.

Using the result from `snprint` or `BLI_snprintf` to step over a fixed
size buffer allows for buffer overruns as the returned value is the size
needed to copy the entire string, not the number of bytes copied.

Building strings using this convention with multiple calls:

ofs += BLI_snprintf(str + ofs, str_len_max - ofs);

.. caused the size argument to become negative,
wrapping it to a large value when cast to the unsigned argument.

Commit Details:

Full Hash: 41f2ea4045b183b7e2d0c5f61d7ab7958267122e
Parent Commit: 1276d00
Lines Changed: +204, -199

18 Modified Paths:

/source/blender/blenkernel/intern/unit.c (+3, -2) (Diff)
/source/blender/blenlib/intern/timecode.c (+2, -2) (Diff)
/source/blender/draw/engines/overlay/overlay_motion_path.c (+2, -2) (Diff)
/source/blender/editors/interface/interface_handlers.c (+1, -1) (Diff)
/source/blender/editors/interface/interface_templates.c (+1, -1) (Diff)
/source/blender/editors/space_clip/clip_buttons.c (+3, -3) (Diff)
/source/blender/editors/space_image/image_buttons.c (+3, -2) (Diff)
/source/blender/editors/space_info/info_stats.c (+61, -61) (Diff)
/source/blender/editors/transform/transform_mode.c (+42, -40) (Diff)
/source/blender/editors/transform/transform_mode_edge_seq_slide.c (+5, -5) (Diff)
/source/blender/editors/transform/transform_mode_edge_slide.c (+4, -4) (Diff)
/source/blender/editors/transform/transform_mode_shrink_fatten.c (+3, -3) (Diff)
/source/blender/editors/transform/transform_mode_timetranslate.c (+2, -2) (Diff)
/source/blender/editors/transform/transform_mode_trackball.c (+13, -13) (Diff)
/source/blender/editors/transform/transform_mode_translate.c (+52, -52) (Diff)
/source/blender/editors/transform/transform_mode_vert_slide.c (+4, -4) (Diff)
/source/blender/imbuf/intern/jpeg.c (+2, -1) (Diff)
/source/blender/python/mathutils/mathutils_Matrix.c (+1, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021