From cfc8dabb88d2f313722416b715f042c9458f939c Mon Sep 17 00:00:00 2001 From: avsm Date: Sat, 26 Apr 2003 20:42:00 +0000 Subject: [PATCH] plug some unbounded sscanf in getopt processing --- audio/faad/patches/patch-frontend_main_c | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 audio/faad/patches/patch-frontend_main_c diff --git a/audio/faad/patches/patch-frontend_main_c b/audio/faad/patches/patch-frontend_main_c new file mode 100644 index 00000000000..7d2346cedb5 --- /dev/null +++ b/audio/faad/patches/patch-frontend_main_c @@ -0,0 +1,39 @@ +$OpenBSD: patch-frontend_main_c,v 1.3 2003/04/26 20:42:00 avsm Exp $ +--- frontend/main.c.orig Sat Apr 26 21:32:51 2003 ++++ frontend/main.c Sat Apr 26 21:33:44 2003 +@@ -542,7 +542,7 @@ int main(int argc, char *argv[]) + case 's': + if (optarg) { + char dr[10]; +- if (sscanf(optarg, "%s", dr) < 1) { ++ if (sscanf(optarg, "%9s", dr) < 1) { + def_srate = 0; + } else { + def_srate = atoi(dr); +@@ -552,7 +552,7 @@ int main(int argc, char *argv[]) + case 'f': + if (optarg) { + char dr[10]; +- if (sscanf(optarg, "%s", dr) < 1) { ++ if (sscanf(optarg, "%9s", dr) < 1) { + format = 1; + } else { + format = atoi(dr); +@@ -564,7 +564,7 @@ int main(int argc, char *argv[]) + case 'b': + if (optarg) { + char dr[10]; +- if (sscanf(optarg, "%s", dr) < 1) { ++ if (sscanf(optarg, "%9s", dr) < 1) { + outputFormat = FAAD_FMT_16BIT; /* just use default */ + } else { + outputFormat = atoi(dr); +@@ -576,7 +576,7 @@ int main(int argc, char *argv[]) + case 'l': + if (optarg) { + char dr[10]; +- if (sscanf(optarg, "%s", dr) < 1) { ++ if (sscanf(optarg, "%9s", dr) < 1) { + object_type = LC; /* default */ + } else { + object_type = atoi(dr);