Skip to content

Commit 75f7276

Browse files
add check
1 parent 80631f4 commit 75f7276

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/brpc/redis_command.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
#include <cctype>
1819
#include <limits>
1920

2021
#include "butil/logging.h"
@@ -388,6 +389,9 @@ ParseError RedisCommandParser::Consume(butil::IOBuf& buf,
388389
}
389390
// '*' stands for array "*<size>\r\n<sub-reply1><sub-reply2>..."
390391
if (!_parsing_array && *pfc != '*') {
392+
if (!std::isalpha(static_cast<unsigned char>(ch))) {
393+
return PARSE_ERROR_TRY_OTHERS;
394+
}
391395
const size_t buf_size = buf.size();
392396
const auto copy_str = static_cast<char *>(arena->allocate(buf_size));
393397
buf.copy_to(copy_str, buf_size);

0 commit comments

Comments
 (0)