From 5a165c60b9b8c4847067cb83b4be7da785d01f93 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 28 Sep 2019 08:17:07 +0100 Subject: gentoo resync : 28.09.2019 --- .../vpopmail/files/vpopmail-5.4.33-strncat.patch | 166 +++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 net-mail/vpopmail/files/vpopmail-5.4.33-strncat.patch (limited to 'net-mail/vpopmail/files/vpopmail-5.4.33-strncat.patch') diff --git a/net-mail/vpopmail/files/vpopmail-5.4.33-strncat.patch b/net-mail/vpopmail/files/vpopmail-5.4.33-strncat.patch new file mode 100644 index 000000000000..f3c9c71b2993 --- /dev/null +++ b/net-mail/vpopmail/files/vpopmail-5.4.33-strncat.patch @@ -0,0 +1,166 @@ +https://sourceforge.net/p/vpopmail/patches/98/ + +--- a/vpopmaild.c (revision 998) ++++ b/vpopmaild.c (working copy) +@@ -1326,7 +1326,7 @@ + } + } + snprintf(newpath, MAXPATH, "%s",myvpw->pw_dir); +- strncat(newpath, &path[i], MAXPATH ); ++ strncat(newpath, &path[i], MAXPATH-strlen(newpath)-1); + } else { /* may be domain name */ + for(i=0;path[i]!='/'&&path[i]!=0&&i<256;++i) { + thedomain[i] = path[i]; +@@ -1337,7 +1337,7 @@ + return(9); + } + snprintf(newpath, MAXPATH, "%s", thedir); +- strncat(newpath, &path[i], MAXPATH ); ++ strncat(newpath, &path[i], MAXPATH-strlen(newpath)-1); + } + } + +@@ -1459,23 +1459,23 @@ + } + snprintf( WriteBuf, sizeof(WriteBuf), "%s", mydirent->d_name); + if ( S_ISREG(statbuf.st_mode ) ) { +- strncat(WriteBuf," file", sizeof(WriteBuf)); ++ strncat(WriteBuf," file", sizeof(WriteBuf)-strlen(WriteBuf)-1); + } else if ( S_ISDIR(statbuf.st_mode ) ) { +- strncat(WriteBuf," dir", sizeof(WriteBuf)); ++ strncat(WriteBuf," dir", sizeof(WriteBuf)-strlen(WriteBuf)-1); + } else if ( S_ISCHR(statbuf.st_mode ) ) { +- strncat(WriteBuf," chardev", sizeof(WriteBuf)); ++ strncat(WriteBuf," chardev", sizeof(WriteBuf)-strlen(WriteBuf)-1); + } else if ( S_ISBLK(statbuf.st_mode ) ) { +- strncat(WriteBuf," blkdev", sizeof(WriteBuf)); ++ strncat(WriteBuf," blkdev", sizeof(WriteBuf)-strlen(WriteBuf)-1); + } else if ( S_ISFIFO(statbuf.st_mode ) ) { +- strncat(WriteBuf," fifo", sizeof(WriteBuf)); ++ strncat(WriteBuf," fifo", sizeof(WriteBuf)-strlen(WriteBuf)-1); + } else if ( S_ISLNK(statbuf.st_mode ) ) { +- strncat(WriteBuf," link", sizeof(WriteBuf)); ++ strncat(WriteBuf," link", sizeof(WriteBuf)-strlen(WriteBuf)-1); + } else if ( S_ISSOCK(statbuf.st_mode ) ) { +- strncat(WriteBuf," sock", sizeof(WriteBuf)); ++ strncat(WriteBuf," sock", sizeof(WriteBuf)-strlen(WriteBuf)-1); + } else { +- strncat(WriteBuf," unknown", sizeof(WriteBuf)); ++ strncat(WriteBuf," unknown", sizeof(WriteBuf)-strlen(WriteBuf)-1); + } +- strncat(WriteBuf,RET_CRLF, sizeof(WriteBuf)); ++ strncat(WriteBuf,RET_CRLF, sizeof(WriteBuf)-strlen(WriteBuf)-1); + wait_write(); + } + if ( closedir(mydir) < 0 ) { +@@ -1604,7 +1604,7 @@ + while(fgets(tmpbuf,sizeof(tmpbuf),fs)!=NULL){ + if ( strcmp(tmpbuf, "." RET_CRLF) == 0 || strcmp(tmpbuf, ".\n") == 0 ) { + snprintf(WriteBuf, sizeof(WriteBuf), "%s", "."); +- strncat(WriteBuf, tmpbuf, sizeof(WriteBuf)); ++ strncat(WriteBuf, tmpbuf, sizeof(WriteBuf)-strlen(WriteBuf)-1); + } else { + memcpy(WriteBuf,tmpbuf,sizeof(tmpbuf)); + } +--- a/vmysql.c (revision 998) ++++ b/vmysql.c (working copy) +@@ -731,7 +731,7 @@ + ); + + if ( sortit == 1 ) { +- strncat( SqlBufRead, " order by pw_name", SQL_BUF_SIZE); ++ strncat( SqlBufRead, " order by pw_name", SQL_BUF_SIZE-strlen(SqlBufRead)-1); + } + + if (res_read!=NULL) mysql_free_result(res_read_getall); +--- a/vldap.c (revision 998) ++++ b/vldap.c (working copy) +@@ -1022,7 +1022,7 @@ + + /* if we are lucky the domain is in the assign file */ + if ( vget_assign(domain,dir_control_file,MAX_DIR_NAME,NULL,NULL)!=NULL ) { +- strncat(dir_control_file, "/.dir-control", MAX_DIR_NAME); ++ strncat(dir_control_file, "/.dir-control", MAX_DIR_NAME-strlen(dir_control_file)-1); + + /* it isn't in the assign file so we have to get it from /etc/passwd */ + } else { +@@ -1041,7 +1041,7 @@ + } + + /* stick on the rest of the path */ +- strncat(dir_control_file, "/" DOMAINS_DIR "/.dir-control", MAX_DIR_NAME); ++ strncat(dir_control_file, "/" DOMAINS_DIR "/.dir-control", MAX_DIR_NAME-strlen(dir_control_file)-1); + } + return(dir_control_file); + } +@@ -1177,7 +1177,7 @@ + char dir_control_file[MAX_DIR_NAME]; + + vget_assign(domain, dir_control_file, 156, NULL,NULL); +- strncat(dir_control_file,"/.dir-control", MAX_DIR_NAME); ++ strncat(dir_control_file,"/.dir-control", MAX_DIR_NAME-strlen(dir_control_file)-1); + return(unlink(dir_control_file)); + } + +--- a/vpopmail.c (revision 998) ++++ b/vpopmail.c (working copy) +@@ -1900,8 +1900,8 @@ + + // Copy the rest of the terms into the domain name + for(j=1;j