- fix another static buffer overflow in fgets

- use update-patches
This commit is contained in:
avsm 2003-04-14 09:46:06 +00:00
parent 6bb79aa158
commit a2f7849d99
5 changed files with 40 additions and 24 deletions

View File

@ -1,5 +1,6 @@
--- Makefile.orig Wed Jan 5 02:47:50 1994
+++ Makefile Sat Apr 8 17:03:47 2000
$OpenBSD: patch-Makefile,v 1.1 2003/04/14 09:46:06 avsm Exp $
--- Makefile.orig Wed Jan 5 01:47:50 1994
+++ Makefile Mon Apr 14 10:41:07 2003
@@ -1,10 +1,18 @@
-ALL : musicin musicout
+CFLAGS += -DPREFIX=\"${PREFIX}\"

View File

@ -1,5 +1,6 @@
--- common.h.orig Wed Jan 5 02:42:00 1994
+++ common.h Mon Oct 8 00:08:30 2001
$OpenBSD: patch-common_h,v 1.1 2003/04/14 09:46:06 avsm Exp $
--- common.h.orig Wed Jan 5 01:42:00 1994
+++ common.h Mon Apr 14 10:41:07 2003
@@ -73,7 +73,7 @@ common.h
#endif

View File

@ -1,6 +1,7 @@
--- musicin.c.orig Tue Jan 4 20:13:44 1994
+++ musicin.c Mon Nov 29 08:57:10 1999
@@ -101,6 +101,8 @@
$OpenBSD: patch-musicin_c,v 1.1 2003/04/14 09:46:06 avsm Exp $
--- musicin.c.orig Wed Jan 5 01:13:44 1994
+++ musicin.c Mon Apr 14 10:41:07 2003
@@ -101,6 +101,8 @@ musicin.c
#include "common.h"
#include "encoder.h"
@ -9,7 +10,7 @@
/* Global variable definitions for "musicin.c" */
FILE *musicin;
@@ -144,7 +146,7 @@
@@ -144,7 +146,7 @@ char encoded_file_name[MAX_NA
do {
printf("Enter PCM input file name <required>: ");
@ -18,7 +19,7 @@
if (original_file_name[0] == NULL_CHAR)
printf("PCM input file name is required.\n");
} while (original_file_name[0] == NULL_CHAR);
@@ -163,7 +165,7 @@
@@ -163,7 +165,7 @@ char encoded_file_name[MAX_NA
original_file_name, DFLT_EXT);
#endif
@ -27,7 +28,7 @@
if (encoded_file_name[0] == NULL_CHAR) {
#ifdef MS_DOS
/* replace old extension with new one, 92-08-19 shn */
@@ -207,7 +209,7 @@
@@ -207,7 +209,7 @@ char encoded_file_name[MAX_NA
else { /* Not using Audio IFF sound file headers. */
printf("What is the sampling frequency? <44100>[Hz]: ");
@ -36,7 +37,7 @@
freq = atol(t);
switch (freq) {
case 48000 : info->sampling_frequency = 1;
@@ -236,7 +238,7 @@
@@ -236,7 +238,7 @@ char encoded_file_name[MAX_NA
printf("Which layer do you want to use?\n");
printf("Available: Layer (1), Layer (<2>): ");
@ -45,7 +46,7 @@
switch(*t){
case '1': info->lay = 1; printf(">>> Using Layer %s\n",t); break;
case '2': info->lay = 2; printf(">>> Using Layer %s\n",t); break;
@@ -246,7 +248,7 @@
@@ -246,7 +248,7 @@ char encoded_file_name[MAX_NA
printf("Which mode do you want?\n");
printf("Available: (<s>)tereo, (j)oint stereo, ");
printf("(d)ual channel, s(i)ngle Channel: ");
@ -54,7 +55,7 @@
switch(*t){
case 's':
case 'S':
@@ -275,7 +277,7 @@
@@ -275,7 +277,7 @@ char encoded_file_name[MAX_NA
}
printf("Which psychoacoustic model do you want to use? <2>: ");
@ -63,7 +64,7 @@
model = atoi(t);
if (model > 2 || model < 1) {
printf(">>> Default model 2 selected\n");
@@ -287,7 +289,7 @@
@@ -287,7 +289,7 @@ char encoded_file_name[MAX_NA
}
printf("What is the total bitrate? <%u>[kbps]: ", DFLT_BRT);
@ -72,7 +73,7 @@
brt = atoi(t);
if (brt == 0) brt = -10;
j=0;
@@ -310,7 +312,7 @@
@@ -310,7 +312,7 @@ char encoded_file_name[MAX_NA
printf("What type of de-emphasis should the decoder use?\n");
printf("Available: (<n>)one, (5)0/15 microseconds, (c)citt j.17: ");
@ -81,7 +82,7 @@
if (*t != 'n' && *t != '5' && *t != 'c') {
printf(">>> Using default no de-emphasis\n");
info->emphasis = 0;
@@ -325,7 +327,7 @@
@@ -325,7 +327,7 @@ char encoded_file_name[MAX_NA
/* Start 2. Part changes for CD Ver 3.2; jsp; 22-Aug-1991 */
printf("Do you want to set the private bit? (y/<n>): ");
@ -90,7 +91,7 @@
if (*t == 'y' || *t == 'Y') info->extension = 1;
else info->extension = 0;
if(info->extension) printf(">>> Private bit set\n");
@@ -334,28 +336,28 @@
@@ -334,28 +336,28 @@ char encoded_file_name[MAX_NA
/* End changes for CD Ver 3.2; jsp; 22-Aug-1991 */
printf("Do you want error protection? (y/<n>): ");

View File

@ -1,6 +1,7 @@
--- musicout.c.orig Tue Jan 4 23:39:27 1994
+++ musicout.c Mon Nov 29 08:57:11 1999
@@ -58,6 +58,8 @@
$OpenBSD: patch-musicout_c,v 1.1 2003/04/14 09:46:06 avsm Exp $
--- musicout.c.orig Wed Jan 5 04:39:27 1994
+++ musicout.c Mon Apr 14 10:41:07 2003
@@ -58,6 +58,8 @@ musicout.c
#include "common.h"
#include "decoder.h"
@ -9,7 +10,7 @@
/********************************************************************
/*
/* This part contains the MPEG I decoder for Layers I & II.
@@ -139,7 +141,7 @@
@@ -139,7 +141,7 @@ typedef double VE[2][HAN_SIZE];
if(argc==1) { /* no command line args -> interact */
do {
printf ("Enter encoded file name <required>: ");
@ -18,7 +19,7 @@
if (encoded_file_name[0] == NULL_CHAR)
printf ("Encoded file name is required. \n");
} while (encoded_file_name[0] == NULL_CHAR);
@@ -151,7 +153,7 @@
@@ -151,7 +153,7 @@ typedef double VE[2][HAN_SIZE];
printf ("Enter MPEG decoded file name <%s%s>: ", encoded_file_name,
DFLT_OPEXT);
#endif
@ -27,7 +28,7 @@
if (decoded_file_name[0] == NULL_CHAR) {
#ifdef MS_DOS
/* replace old extension with new one, 92-08-19 shn */
@@ -164,7 +166,7 @@
@@ -164,7 +166,7 @@ typedef double VE[2][HAN_SIZE];
printf(
"Do you wish to write an AIFF compatible sound file ? (y/<n>) : ");
@ -36,7 +37,7 @@
if (*t == 'y' || *t == 'Y') need_aiff = TRUE;
else need_aiff = FALSE;
if (need_aiff)
@@ -173,7 +175,7 @@
@@ -173,7 +175,7 @@ typedef double VE[2][HAN_SIZE];
printf(
"Do you wish to exit (last chance before decoding) ? (y/<n>) : ");

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-psy_c,v 1.1 2003/04/14 09:46:06 avsm Exp $
--- psy.c.orig Mon Apr 14 10:41:19 2003
+++ psy.c Mon Apr 14 10:41:48 2003
@@ -428,7 +428,7 @@ int table;
printf("Please check %s table\n", ta);
exit(1);
}
- fgets(t, 150, fp);
+ fgets(t, sizeof t, fp);
sscanf(t, "table %ld", &index);
if(index != table){
printf("error in absthr table %s",ta);