Skip to content
Snippets Groups Projects
Commit af20494b authored by ale's avatar ale
Browse files

Do not allow the first field (version) to be empty

parent 39c00746
No related branches found
No related tags found
1 merge request!5Refactor ticket deserialization code
......@@ -210,16 +210,15 @@ static int sso_ticket_deserialize(sso_ticket_t *t, char *s) {
sso_ticket_t tmp = sso_ticket_new(NULL, NULL, NULL, NULL, NULL, NULL, 0);
int i;
/*
* Split s into fields, which may be empty.
*/
// Split s into fields, which may be empty.
for (i = 0, ss = s; ss; i++) {
token = ss;
ss = strchr(ss, FIELD_SEP_CH);
if (ss != NULL) {
*ss++ = '\0';
}
if (*token == 0) {
// Skip empty fields, except for the first one.
if (i > 0 && *token == 0) {
continue;
}
switch (i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment