You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
attrs.c
DefinePriorityAttribute allocates priorities->list using TidyAlloc(), but re-allocates using realloc() instead of TidyRealloc(), which crashes if TidyAlloc didn't allocate memory via malloc
message.c
DefineMutedMessage allocates list->list using TidyAlloc(), but re-allocates using realloc() instead of TidyRealloc(), which crashes if TidyAlloc didn't allocate memory via malloc
Compiles in XCode 10 clang on Mac, Visual Studio 2015 on Windows
Tested in production on macOS 10.13, macOS 10.14, Windows 7, Windows 10, Windows Server 2016
Activity
geoffmcl commentedon Jan 28, 2019
@dd8 thanks for catching this
not very obviousbug... but easy to see, when you know what to look for...Given that
libTidyhas a memory TidyAllocator, that users can set to what they want,realloc()should not be used in the raw, in those 2 cases...Will try to include this easy fix somewhere... unless someone beats me to it, with say a
patch, orPR... thanks...dd8 commentedon Jan 28, 2019
I do have a patch which has been tested in production, so I can package that up and attach it to this issue
geoffmcl commentedon Jan 28, 2019
@dd8 that would be appreciated... maybe I can then include it in the next
mergeI do... thanks...dd8 commentedon Jan 29, 2019
Here's the patch
patch-realloc.diff.txt
Compiles in XCode 10 clang on Mac, Visual Studio 2015 on Windows
Tested in production on macOS 10.13, macOS 10.14, Windows 7, Windows 10, Windows Server 2016
Not tested on Linux/gcc
Is #797 - use 'TidyRealloc' in place of raw 'realloc'
geoffmcl commentedon Jan 31, 2019
@dd8 now applied, version 5.7.22... thanks...
Is htacg#797 - Bump to 5.7.21 for this fix - closes htacg#797