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 <[email protected]. Uploaders: Andreas Tille <[email protected]> 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.
_______________________________________________ debian-med-commit mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit
