Problem: Allocating more memory than needed for extended structs.
Solution: Use offsetof() instead of sizeof(). (Dominique Pelle,
closes #4785)
{
dictitem_T *di;
- di = alloc(sizeof(dictitem_T) + STRLEN(key));
+ di = alloc(offsetof(dictitem_T, di_key) + STRLEN(key) + 1);
if (di != NULL)
{
STRCPY(di->di_key, key);
{
dictitem_T *di;
- di = alloc(sizeof(dictitem_T) + STRLEN(org->di_key));
+ di = alloc(offsetof(dictitem_T, di_key) + STRLEN(org->di_key) + 1);
if (di != NULL)
{
STRCPY(di->di_key, org->di_key);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1825,
/**/
1824,
/**/