[med-svn] [conquest-dicom-server] 04/04: Patch device.cxx to fix strncpy use.
Pablo Lorenzzoni
spectra at moszumanska.debian.org
Wed Feb 5 17:33:25 UTC 2014
This is an automated email from the git hooks/post-receive script.
spectra pushed a commit to branch master
in repository conquest-dicom-server.
commit a7d90d6d1a9cf2ddbcff4b3585d36d8752155372
Author: Pablo Lorenzzoni <spectra at debian.org>
Date: Wed Feb 5 14:37:40 2014 +0000
Patch device.cxx to fix strncpy use.
---
debian/patches/0011-Fix-cppcheck-bug-4.patch | 23 +++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 24 insertions(+)
diff --git a/debian/patches/0011-Fix-cppcheck-bug-4.patch b/debian/patches/0011-Fix-cppcheck-bug-4.patch
new file mode 100644
index 0000000..0841ad4
--- /dev/null
+++ b/debian/patches/0011-Fix-cppcheck-bug-4.patch
@@ -0,0 +1,23 @@
+From: Pablo Lorenzzoni <spectra at debian.org>
+Date: Wed, 5 Feb 2014 14:36:36 +0000
+Subject: Fix cppcheck bug #4
+
+[device.cpp:786]: (error) Dangerous usage of 's' (strncpy doesn't always 0-terminate it)
+---
+ device.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/device.cpp b/device.cpp
+index 2b07c7c..3afb058 100644
+--- a/device.cpp
++++ b/device.cpp
+@@ -781,7 +781,8 @@ CheckFreeStoreOnCACHEDevice(
+
+ if (CACHENumber >= CACHEDevices || CACHENumber < 0) return 0;
+
+- strncpy(s, CACHEDeviceTable[CACHENumber], 1023);
++ strncpy(s, CACHEDeviceTable[CACHENumber], 1023);
++ s[1023] = '\0';
+
+ if ((chp = strchr(s, '%')))
+ {
diff --git a/debian/patches/series b/debian/patches/series
index 42b39df..8966b77 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@
0008-Fix-cppcheck-bug-6.patch
0009-Fix-cppcheck-bug-1.patch
0010-Fix-cppcheck-bug-3-and-others-in-same-function.patch
+0011-Fix-cppcheck-bug-4.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/conquest-dicom-server.git
More information about the debian-med-commit
mailing list