Commit 700f3049 authored by zyddnys's avatar zyddnys

IMSI can be less than 15 chars

parent 5ec6c48f
...@@ -19,7 +19,7 @@ Supi Supi::Parse(const std::string &supi) ...@@ -19,7 +19,7 @@ Supi Supi::Parse(const std::string &supi)
if (supi[0] == 'i' && supi[1] == 'm' && supi[2] == 's' && supi[3] == 'i' && supi[4] == '-') if (supi[0] == 'i' && supi[1] == 'm' && supi[2] == 's' && supi[3] == 'i' && supi[4] == '-')
{ {
std::string val = supi.substr(5); std::string val = supi.substr(5);
if (val.size() != 15) if (val.size() > 15)
throw std::runtime_error("invalid IMSI value"); throw std::runtime_error("invalid IMSI value");
for (char c : val) for (char c : val)
if (c < '0' || c > '9') if (c < '0' || c > '9')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment