diff options
author | Ken Hughes <khughes@pacific.edu> | 2007-02-01 23:25:24 +0300 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2007-02-01 23:25:24 +0300 |
commit | ccf72a2e26874056fc4b657f9e260691d01cbc95 (patch) | |
tree | 5e934d0bec12cc20e0dfaa4329125a546f1fed1c /source/blender/src/drawview.c | |
parent | 1d5aa3faea782c70854389e1b30e1870c1980773 (diff) |
Tools
---------------
Bugfix #5898: buffer overrun by sprintf() in v3d_editvertex_buts() caused a
crash. Changed to snprintf().
Diffstat (limited to 'source/blender/src/drawview.c')
-rw-r--r-- | source/blender/src/drawview.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index c93e1f677ed..533ffff7165 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -42,6 +42,12 @@ #include <io.h> #endif +#ifdef WIN32 +#ifndef snprintf +#define snprintf _snprintf +#endif +#endif + #include "MEM_guardedalloc.h" #include "PIL_time.h" @@ -1535,7 +1541,7 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim) for (i=0; i<dvert->totweight; i++){ dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr); if(dg) { - max+= sprintf(str, "%s %%x%d|", dg->name, dvert->dw[i].def_nr); + max+= snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr); if(max<320) strcat(defstr, str); } else printf("oh no!\n"); |