}
/* get identauth */
- if (!q || (*q != '-')) {
conv = (uint32_t) strtoul(q, &q, 10);
+ if (!q) {
+ goto format_error;
+ } else if (*q == '\0') {
+ /* Just id_auth, no subauths */
+ } else if (*q != '-') {
goto format_error;
}
/* identauth in decimal should be < 2^32 */
sidout->id_auth[4] = (conv & 0x0000ff00) >> 8;
sidout->id_auth[5] = (conv & 0x000000ff);
- q++;
sidout->num_auths = 0;
+ if (*q == '\0') {
+ return true;
+ }
+
+ q++;
while (true) {
char *end;