[Pkg-owncloud-commits] [owncloud-client] 280/484: Discovery: silent static analysis warning

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit aa27b5db14a9345ebde95dc2ebce9c711cb38d16
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Nov 9 15:05:53 2015 +0100

    Discovery: silent static analysis warning
    
    We do a check one line earlier that the size is smaller than the buffer
    Then we don't need to call strncpy,  strcpy is enough
---
 src/libsync/discoveryphase.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp
index cb4c4dd..034239f 100644
--- a/src/libsync/discoveryphase.cpp
+++ b/src/libsync/discoveryphase.cpp
@@ -278,7 +278,7 @@ static csync_vio_file_stat_t* propertyMapToFileStat(const QMap<QString,QString>
                 // see _csync_detect_update()
                 file_stat->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERM;
             } else if (v.length() < int(sizeof(file_stat->remotePerm))) {
-                strncpy(file_stat->remotePerm, v.constData(), sizeof(file_stat->remotePerm));
+                strcpy(file_stat->remotePerm, v.constData());
                 file_stat->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERM;
             } else {
                 qWarning() << "permissions too large" << v;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list