[med-svn] [Git][med-team/perm][master] Fixed buffer overflow :-)
Nilesh Patra (@nilesh)
gitlab at salsa.debian.org
Mon Aug 2 16:53:33 BST 2021
Nilesh Patra pushed to branch master at Debian Med / perm
Commits:
8034f604 by Nilesh Patra at 2021-08-02T21:22:22+05:30
Fixed buffer overflow :-)
- - - - -
3 changed files:
- debian/control
- + debian/patches/fix-buffer-overflow.patch
- debian/patches/series
Changes:
=====================================
debian/control
=====================================
@@ -3,7 +3,7 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.
Uploaders: Andreas Tille <tille at debian.org>
Section: science
Priority: optional
-Build-Depends: debhelper-compat (= 13)
+Build-Depends: debhelper-compat (= 13), libbsd-dev
Standards-Version: 4.5.1
Vcs-Browser: https://salsa.debian.org/med-team/perm
Vcs-Git: https://salsa.debian.org/med-team/perm.git
=====================================
debian/patches/fix-buffer-overflow.patch
=====================================
@@ -0,0 +1,39 @@
+--- a/makefile
++++ b/makefile
+@@ -2,7 +2,7 @@
+ CC = g++ -O2 $(CFLAGS)
+
+ TARGETS = perm
+-LIBS = -lm -lstdc++
++LIBS = -lm -lstdc++ -lbsd
+
+ PER_M = AlignmentsQ.cpp Filename.cpp GenomeNTdata.cpp ReadInBits.cpp PerM.cpp chromosomeNTdata.cpp\
+ bitsOperationUtil.cpp FileOutputBuffer.cpp HashIndexT.cpp ReadInBitsSet.cpp SeedPattern.cpp\
+--- a/stdafx.h
++++ b/stdafx.h
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include "time.h"
+ #include "Filename.h"
++#include <bsd/string.h>
+ //#ifdef WIN32
+ #include "chdir.h"
+ //#else
+@@ -174,14 +175,14 @@
+ return(true);
+ }
+
+-inline char* myStrCpy(char* caBuf, const char* str, int iBufSize)
++inline int myStrCpy(char* caBuf, const char* str, int iBufSize)
+ {
+ if (caBuf == NULL) {
+ ERR;
+- return(NULL);
++ return(-1);
+ }
+ int iBufSizeMinus1 = iBufSize - 1;
+- char* returnV = strncpy(caBuf, str, iBufSizeMinus1);
++ int returnV = strlcpy(caBuf, str, iBufSizeMinus1);
+ if (iBufSizeMinus1 >= 0) {
+ caBuf[iBufSizeMinus1] = '\0';
+ } else {
=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@ make_dynamic_executable.patch
hardening.patch
spelling.patch
gcc7.patch
+fix-buffer-overflow.patch
View it on GitLab: https://salsa.debian.org/med-team/perm/-/commit/8034f60434e71f71eaa180faf417cc63a2871e87
--
View it on GitLab: https://salsa.debian.org/med-team/perm/-/commit/8034f60434e71f71eaa180faf417cc63a2871e87
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210802/1c5d3420/attachment-0001.htm>
More information about the debian-med-commit
mailing list