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
When the sum overflows, the argument numSamples becomes a negative value.
The allocation function potentially fails because the if guard at sonic.c:463 fails to filter the value of outputBufferSize.
A possible fix suggestion would be adding an additional safety function and using it before calling the function.
For example,
size_t sonicSafeAdd(size_t a, size_t b) {
size_t sum = a + b;
if (sum >= SIZE_MAX || sum < a) {
/// handle exit
}
return sum;
}
Dear authors,
There exists a potential integer overflow at the function
insertPitchPeriod
atsonic/sonic.c
Line 1056 in 8694c59
caused by
period + newSamples
which can lead to an allocation error atsonic.c:465:37 enlargeOutputBufferIfNeeded
.sonic/sonic.c
Lines 460 to 469 in 8694c59
When the sum overflows, the argument
numSamples
becomes a negative value.The allocation function potentially fails because the if guard at
sonic.c:463
fails to filter the value ofoutputBufferSize
.A possible fix suggestion would be adding an additional safety function and using it before calling the function.
For example,
Could be used as
Thank you
The text was updated successfully, but these errors were encountered: