signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.54k stars 1.41k forks source link

[Core] Fix memset issue in hashtable_expand() #2488

Open akscf opened 3 months ago

akscf commented 3 months ago

Hi there, here seems is a mistake:

switch_hashtable.c:129:
memset(newtable[h->tablelength], 0, newsize - h->tablelength);

if plan-b have ever happen, that will lead to permanent crash, should be:

memset(&newtable[h->tablelength], 0, ((newsize - h->tablelength) * sizeof(struct entry*)));