Read a single token from token array. */
| 49 | Read a single token from token array. |
| 50 | */ |
| 51 | inline uint read_token(const sql_digest_storage *digest_storage, |
| 52 | uint index, uint *tok) |
| 53 | { |
| 54 | uint safe_byte_count= digest_storage->m_byte_count; |
| 55 | |
| 56 | if (index + SIZE_OF_A_TOKEN <= safe_byte_count && |
| 57 | safe_byte_count <= digest_storage->m_token_array_length) |
| 58 | { |
| 59 | const unsigned char *src= & digest_storage->m_token_array[index]; |
| 60 | *tok= src[0] | (src[1] << 8); |
| 61 | return index + SIZE_OF_A_TOKEN; |
| 62 | } |
| 63 | |
| 64 | /* The input byte stream is exhausted. */ |
| 65 | *tok= 0; |
| 66 | return MAX_DIGEST_STORAGE_SIZE + 1; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | Store a single token in token array. |
no outgoing calls
no test coverage detected