Skip to content

Commit eda07a0

Browse files
added name validation
1 parent 11c23ba commit eda07a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

postman/src/Connection.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ void Connection::queueBind(std::string name) {
138138

139139
void Connection::queueDeclare(std::string name, std::string bindingKey,
140140
bool persistence, bool durability) {
141+
142+
if(!std::regex_match(name, namePattern)) {
143+
throw PostmanConnectionException("Name contains strange characters!");
144+
}
141145
if (!std::regex_match(bindingKey, bindingKeyPattern)) {
142146
throw PostmanConnectionException("Binding key is wrong!");
143147
}

0 commit comments

Comments
 (0)