瀏覽代碼

Found the buffer overflow

Ian Goldberg 2 年之前
父節點
當前提交
465c00d6a5
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      preprocessing/preprocessing.cpp

+ 2 - 1
preprocessing/preprocessing.cpp

@@ -196,7 +196,7 @@ int main(int argc, char * argv[])
 
     boost::asio::thread_pool pool_xor_to_additive(thread_per_batch); 
 
-    std::array<int64_t, 128> additve_shares; 
+    int64_t *additve_shares = new int64_t[thread_per_batch]; 
     for(size_t j = 0; j < thread_per_batch; ++j)
     {
      boost::asio::post(pool_xor_to_additive, std::bind(xor_to_additive, party, target_share_read[j], std::ref(socketsPb[j]), std::ref(socketsP2[j]), expo, std::ref(additve_shares[j])));
@@ -229,6 +229,7 @@ int main(int argc, char * argv[])
       std::cout << "add_ = " << add_ << std::endl;
      }
     #endif
+    delete[] additve_shares;
     
     return 0;
 }