Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
audio/zynaddsubfx: Fix buffer overflows
- Leave room for termination NUL in sscanf buffer. - Use float instead of float_t. On FreeBSD/i386 they are not the same. Discovered during an exp-run for bug 276478.
- Loading branch information
1 parent
9827f3b
commit 0eb74ba
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
PORTNAME= zynaddsubfx | ||
DISTVERSION= 3.0.6 | ||
PORTREVISION= 2 | ||
PORTREVISION= 3 | ||
PORTEPOCH= 2 | ||
CATEGORIES= audio | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- rtosc/src/cpp/savefile.cpp.orig 2021-12-31 15:58:28 UTC | ||
+++ rtosc/src/cpp/savefile.cpp | ||
@@ -534,7 +534,7 @@ int load_from_file(const char* file_content, | ||
n = 0; | ||
|
||
sscanf(file_content, | ||
- "%% %128s v%u.%u.%u%n ", appbuf, &vma, &vmi, &vre, &n); | ||
+ "%% %127s v%u.%u.%u%n ", appbuf, &vma, &vmi, &vre, &n); | ||
if(n <= 0 || strcmp(appbuf, appname) || vma > 255 || vmi > 255 || vre > 255) | ||
return -bytes_read-1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- src/Effects/Distorsion.cpp.orig 2022-01-22 01:46:21 UTC | ||
+++ src/Effects/Distorsion.cpp | ||
@@ -75,7 +75,7 @@ rtosc::Ports Distorsion::ports = { | ||
|
||
for(int i=0; i<128; ++i) | ||
buffer[i] = 2*(i/128.0)-1; | ||
- memcpy(orig, buffer, sizeof(float_t)*128); | ||
+ memcpy(orig, buffer, sizeof(buffer)); | ||
|
||
waveShapeSmps(sizeof(buffer)/sizeof(buffer[0]), buffer, | ||
dd.Ptype + 1, dd.Pdrive, dd.Poffset, dd.Pfuncpar); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- src/Synth/ADnote.cpp.orig 2022-01-22 01:46:21 UTC | ||
+++ src/Synth/ADnote.cpp | ||
@@ -1264,7 +1264,7 @@ inline void ADnote::ComputeVoiceOscillator_SincInterpo | ||
inline void ADnote::ComputeVoiceOscillator_SincInterpolation(int nvoice) | ||
{ | ||
// windowed sinc kernel factor Fs*0.3, rejection 80dB | ||
- const float_t kernel[] = { | ||
+ const float kernel[] = { | ||
0.0010596256917418426f, | ||
0.004273442181254887f, | ||
0.0035466063043375785f, |