summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Ahlberg <aliz@gentoo.org>2003-06-28 21:15:02 +0000
committerDaniel Ahlberg <aliz@gentoo.org>2003-06-28 21:15:02 +0000
commit0b39036eb4a6e4bcb7918b765cb3748d8b60f67c (patch)
treec1e91abb4c0df634aa6454b2684bbf6e13a6db15 /media-sound/mikmod/files/mikmod-3.1.6-security.patch
parentVersion bumped. (diff)
downloadgentoo-2-0b39036eb4a6e4bcb7918b765cb3748d8b60f67c.tar.gz
gentoo-2-0b39036eb4a6e4bcb7918b765cb3748d8b60f67c.tar.bz2
gentoo-2-0b39036eb4a6e4bcb7918b765cb3748d8b60f67c.zip
security update
Diffstat (limited to 'media-sound/mikmod/files/mikmod-3.1.6-security.patch')
-rw-r--r--media-sound/mikmod/files/mikmod-3.1.6-security.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/media-sound/mikmod/files/mikmod-3.1.6-security.patch b/media-sound/mikmod/files/mikmod-3.1.6-security.patch
new file mode 100644
index 000000000000..8e02f8e89f5c
--- /dev/null
+++ b/media-sound/mikmod/files/mikmod-3.1.6-security.patch
@@ -0,0 +1,79 @@
+diff -Ndur mikmod-3.1.6.orig/src/marchive.c mikmod-3.1.6/src/marchive.c
+--- mikmod-3.1.6.orig/src/marchive.c 2003-06-02 18:35:38.000000000 +0200
++++ mikmod-3.1.6/src/marchive.c 2003-06-03 14:24:57.000000000 +0200
+@@ -269,6 +269,10 @@
+ {
+ int t;
+
++ /* a filename may not start with '-' since this could be abused to
++ feed another option to the archiver */
++ if (filename[0]=='-')
++ return 0;
+ for (t=0;modulepatterns[t];t++)
+ if (!fnmatch(modulepatterns[t],filename,FNM_NOESCAPE))
+ return 1;
+@@ -522,8 +526,8 @@
+
+ if (!pipe(fd)) {
+ pid_t pid;
+- int status,cur,finished=0;
+- char ch;
++ FILE *file;
++ int status,s;
+
+ switch (pid=fork()) {
+ case -1: /* fork failed */
+@@ -553,40 +557,22 @@
+ }
+ break;
+ default: /* fork succeeded, main process code */
+- /* have to wait for the child to ensure the command was
+- successful and the pipe contains useful
+- information */
+
+- /* read from the pipe */
+ close(fd[1]);
+- cur=0;
+- for (;;) {
+- /* check if child process has finished */
+- if ((!finished)&&(waitpid(pid,&status,WNOHANG))) {
+- finished=1;
+- /* abnormal exit */
+- if (!WIFEXITED(status)) {
+- close(fd[0]);
+- break;
+- }
+- }
+-
+- /* check for end of pipe, otherwise read char */
+- if ((!read(fd[0],&ch,1))&&(finished)) break;
+-
+- if (ch=='\n') ch=0;
+- string[cur++]=ch;
+- if (!ch) {
+- cur=0;
+- if (!MA_archiver[archive].nameoffset) {
+- for (t=0;string[t]!=' ';t++);
+- string[t]=0;
+- }
+- if (MA_isModuleFilename2(string+MA_archiver[archive].nameoffset))
+- PL_Add(pl,(string+MA_archiver[archive].nameoffset),filename,0,0);
+- }
++ if (!(file=fdopen(fd[0],"r"))) {
++ close(fd[1]);
++ waitpid(pid,&status,0);
++ break;
+ }
+- close(fd[0]);
++ /* read from the pipe */
++ while (fgets(string,PATH_MAX+MAXCOLUMN+1,file)) {
++ s=strlen(string)-1;
++ if (string[s]=='\n') string[s]='\0';
++ if (MA_isModuleFilename2(string+MA_archiver[archive].nameoffset))
++ PL_Add(pl,(string+MA_archiver[archive].nameoffset),filename,0,0);
++ }
++ fclose(file);
++ waitpid(pid,&status,0);
+ break;
+ }
+ }