fix buffer overflow

This commit is contained in:
brad 2003-12-15 21:23:20 +00:00
parent 550c87ad20
commit 7266b9df98
2 changed files with 27 additions and 1 deletions

View File

@ -1,10 +1,12 @@
# $OpenBSD: Makefile,v 1.8 2003/12/08 02:27:52 brad Exp $
# $OpenBSD: Makefile,v 1.9 2003/12/15 21:23:20 brad Exp $
COMMENT= "KDE personal information applications"
COMMENT-kpilot= "synch with palm pilot"
CATEGORIES= x11 x11/kde productivity
VERSION= 3.1.4
DISTNAME= kdepim-${VERSION}
PKGNAME= ${DISTNAME}p1
LIB_DEPENDS= kdecore.4,DCOP,kabc,kdefx,kdeprint,kdesu,kdeui,kio,kparts,vcard::x11/kde/libs3
BUILD_DEPENDS= ::comms/pilot-link

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-kfile-plugins_vcf_kfile_vcf_cpp,v 1.1 2003/12/15 21:23:20 brad Exp $
--- kfile-plugins/vcf/kfile_vcf.cpp.orig 2003-12-15 14:36:28.000000000 -0500
+++ kfile-plugins/vcf/kfile_vcf.cpp 2003-12-15 14:37:29.000000000 -0500
@@ -90,17 +90,17 @@ bool KVcfPlugin::readInfo( KFileMetaInfo
while (!done) {
// read a line
- file.readLine(linebuf, 4096);
+ file.readLine(linebuf, sizeof(linebuf));
// have we got something useful?
if (memcmp(linebuf, id_name, 3) == 0) {
// we have a name
myptr = linebuf + 3;
- strncpy(buf_name, myptr, 999);
+ strncpy(buf_name, myptr, sizeof( buf_name ));
} else if (memcmp(linebuf, id_email, 15) == 0) {
// we have a name
myptr = linebuf + 15;
- strncpy(buf_email, myptr, 999);
+ strncpy(buf_email, myptr, sizeof( buf_email ));
}
// are we done yet?