From a07c33aaae604ace83bd133e65a41073585dbe36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Wed, 6 Dec 2017 11:10:06 +0100 Subject: [PATCH] fixed GH #2038: Poco::Net::MultipartWriter::createBoundary() always returns the same string. --- Net/src/MultipartWriter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Net/src/MultipartWriter.cpp b/Net/src/MultipartWriter.cpp index 849907ba8..831fae107 100644 --- a/Net/src/MultipartWriter.cpp +++ b/Net/src/MultipartWriter.cpp @@ -48,7 +48,7 @@ MultipartWriter::~MultipartWriter() { } - + void MultipartWriter::nextPart(const MessageHeader& header) { if (_firstPart) @@ -60,7 +60,7 @@ void MultipartWriter::nextPart(const MessageHeader& header) _ostr << "\r\n"; } - + void MultipartWriter::close() { _ostr << "\r\n--" << _boundary << "--\r\n"; @@ -77,6 +77,7 @@ std::string MultipartWriter::createBoundary() { std::string boundary("MIME_boundary_"); Random rnd; + rnd.seed(); NumberFormatter::appendHex(boundary, rnd.next(), 8); NumberFormatter::appendHex(boundary, rnd.next(), 8); return boundary;