Use snprintf() instead of sprintf() 28/270128/1
authorSeonah Moon <seonah1.moon@samsung.com>
Wed, 26 Jan 2022 04:53:36 +0000 (13:53 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 26 Jan 2022 04:53:47 +0000 (13:53 +0900)
Change-Id: Iaad7f92e36941bbe2eac55f941e9ad24e79be703

packaging/capi-network-vine.spec
src/vine-dp.cpp

index fb39f98..0ea5551 100755 (executable)
@@ -3,7 +3,7 @@
 %bcond_without use_glib_event_loop
 Name:    capi-network-vine
 Summary: An service discovery framework
-Version: 1.2.7
+Version: 1.2.8
 Release: 0
 Group:   Network & Connectivity/API
 License: Apache-2.0
index 23806c4..2a16363 100755 (executable)
@@ -1253,7 +1253,7 @@ int DPPubSub::publish_service()
        vine_service_set_port(service, mListenPort);
 
        mRank = create_rank();
-       sprintf(rank_str, "%d", mRank);
+       snprintf(rank_str, VINE_DP_PUBSUB_RANK_LEN, "%d", mRank);
 
        vine_service_set_name(service, mId.c_str());
        vine_service_add_attribute(service, VINE_DP_PUBSUB_RANK_KEY, (const char *)rank_str);