diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-12 10:53:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-12 10:53:47 +0400 |
commit | aedd4af57e5777dd32585560980f4661ec4d491d (patch) | |
tree | 81d7514200d498b01ef621c83052cf5f42aac84f /source/blender/blenlib | |
parent | 0873cbaed5aea31f3fc8b16dacecb2d332c9b6f5 (diff) |
code cleanup/bugfix uninitialized values
- edgebisect bmesh operator used uninialized beauty field.
- BLI_join_dirfile could read from before the string bounds when passed an empty dir string.
- pransform could use an uninitialized projected coordinate (unlikely but possible)
- RNA_property_path_from_ID_check would compare against an uninitialized pointer when the path wasn't found.
also have bmesh walker use BM_edge_other_vert() utility function.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 0d251133e0d..dccec7a6a42 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1523,9 +1523,9 @@ void BLI_join_dirfile(char *dst, const size_t maxlen, const char *dir, const cha } /* inline BLI_add_slash */ - if (dst[dirlen - 1] != SEP) { - dst[dirlen++]= SEP; - dst[dirlen ]= '\0'; + if ((dirlen > 0) && (dst[dirlen - 1] != SEP)) { + dst[dirlen++] = SEP; + dst[dirlen ] = '\0'; } if (dirlen >= maxlen) { |