Skip to content

Commit 947cae0

Browse files
author
Damir Zainullin
committed
TLS - Fix empty string pop_back() if all elliptic curve point formats
are grease values
1 parent a24b8e2 commit 947cae0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/plugins/process/tls/src/tls.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ static std::string concatenate_vector_to_hex_string(const std::vector<uint16_t>&
153153
static std::string
154154
concatenate_extensions_vector_to_string(const std::vector<TLSExtension>& extensions)
155155
{
156-
if (extensions.empty()) {
157-
return "";
158-
}
159156
auto res = std::accumulate(
160157
extensions.begin(),
161158
extensions.end(),
@@ -166,7 +163,10 @@ concatenate_extensions_vector_to_string(const std::vector<TLSExtension>& extensi
166163
}
167164
return a + std::to_string(extension.type) + "-";
168165
});
169-
res.pop_back();
166+
167+
if (!res.empty()) {
168+
res.pop_back();
169+
}
170170
return res;
171171
}
172172

0 commit comments

Comments
 (0)