general: Fix memory Corruption in __ast_string_field_ptr_build_va.
authorWalter Doekes <walter+asterisk@wjd.nu>
Mon, 11 Aug 2014 10:41:07 +0000 (10:41 +0000)
committerWalter Doekes <walter+asterisk@wjd.nu>
Mon, 11 Aug 2014 10:41:07 +0000 (10:41 +0000)
commit1e0846167b008637e413069ed6ce608c9b65c3c8
tree5cdf7a158af5e356e5a41a08803873b231309ea5
parentb2afbc48e4daf1a0c05fb81a25f48b176d307c1e
general: Fix memory Corruption in __ast_string_field_ptr_build_va.

If the space left in a stringfield is between 0 and
(alignof(ast_string_field_allocation)-1) adding new data would cause
memory corruption, because we would assume enough space (unsigned
underrun).

Thanks Arnd Schmitter for reporting and finding out the cause!

ASTERISK-23508 #close
Reported by: Arnd Schmitter
Tested by: Arnd Schmitter, JoshE

Review: https://reviewboard.asterisk.org/r/3898/
........

Merged revisions 420680 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 420715 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 420716 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 420717 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/utils.c