validateQuery verifies that the query does not contain any preds that are longer than the limit (2^16).
(queries []*dql.GraphQuery)
| 2385 | // validateQuery verifies that the query does not contain any preds that |
| 2386 | // are longer than the limit (2^16). |
| 2387 | func validateQuery(queries []*dql.GraphQuery) error { |
| 2388 | for _, q := range queries { |
| 2389 | if err := validatePredName(q.Attr); err != nil { |
| 2390 | return err |
| 2391 | } |
| 2392 | |
| 2393 | if err := validateQuery(q.Children); err != nil { |
| 2394 | return err |
| 2395 | } |
| 2396 | } |
| 2397 | |
| 2398 | return nil |
| 2399 | } |
| 2400 | |
| 2401 | func validatePredName(name string) error { |
| 2402 | if len(name) > math.MaxUint16 { |
no test coverage detected