celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [18/50] [abbrv] celix git commit: Fixed Coverity issue
Date Tue, 30 Jan 2018 19:19:14 GMT
Fixed Coverity issue


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/5fbeb4b8
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/5fbeb4b8
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/5fbeb4b8

Branch: refs/heads/master
Commit: 5fbeb4b8e3a0f84847d368b6bcff6909aca8e034
Parents: 27b9648
Author: gricciardi <gricciardi@apache.org>
Authored: Wed Nov 8 21:05:37 2017 +0100
Committer: gricciardi <gricciardi@apache.org>
Committed: Wed Nov 8 21:05:37 2017 +0100

----------------------------------------------------------------------
 .../private/src/pubsub_serializer_impl.c                       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/5fbeb4b8/pubsub/pubsub_serializer_json/private/src/pubsub_serializer_impl.c
----------------------------------------------------------------------
diff --git a/pubsub/pubsub_serializer_json/private/src/pubsub_serializer_impl.c b/pubsub/pubsub_serializer_json/private/src/pubsub_serializer_impl.c
index 7f56c52..685d499 100644
--- a/pubsub/pubsub_serializer_json/private/src/pubsub_serializer_impl.c
+++ b/pubsub/pubsub_serializer_json/private/src/pubsub_serializer_impl.c
@@ -42,6 +42,7 @@
 #include "pubsub_serializer_impl.h"
 
 #define SYSTEM_BUNDLE_ARCHIVE_PATH 		"CELIX_FRAMEWORK_EXTENDER_PATH"
+#define MAX_PATH_LEN    1024
 
 static char* pubsubSerializer_getMsgDescriptionDir(bundle_pt bundle);
 static void pubsubSerializer_addMsgSerializerFromBundle(const char *root, bundle_pt bundle,
hash_map_pt msgTypesMap);
@@ -212,7 +213,7 @@ static char* pubsubSerializer_getMsgDescriptionDir(bundle_pt bundle)
 
 static void pubsubSerializer_addMsgSerializerFromBundle(const char *root, bundle_pt bundle,
hash_map_pt msgSerializers)
 {
-	char path[128];
+	char path[MAX_PATH_LEN];
 	struct dirent *entry = NULL;
 	DIR *dir = opendir(root);
 
@@ -226,8 +227,7 @@ static void pubsubSerializer_addMsgSerializerFromBundle(const char *root,
bundle
 
 			printf("DMU: Parsing entry '%s'\n", entry->d_name);
 
-			memset(path,0,1024);
-			snprintf(path, 1024, "%s/%s", root, entry->d_name);
+			snprintf(path, MAX_PATH_LEN, "%s/%s", root, entry->d_name);
 			FILE *stream = fopen(path,"r");
 
 			if (stream != NULL){


Mime
View raw message