test/handshake_helper.c:194: error: INTEGER_OVERFLOW_L2
  ([0, `protos->strlen` - 1] - [0, max(2, `protos->strlen`)]):unsigned64.
Showing all 5 steps of the trace


test/handshake_helper.c:191:5: <LHS trace>
189.   
190.       prefix = 0;
191.       i = prefix + 1;
           ^
192.       while (i <= len) {
193.           if ((*out)[i] == ',') {

test/handshake_helper.c:191:5: Assignment
189.   
190.       prefix = 0;
191.       i = prefix + 1;
           ^
192.       while (i <= len) {
193.           if ((*out)[i] == ',') {

test/handshake_helper.c:190:5: <RHS trace>
188.       memcpy(*out + 1, protos, len);
189.   
190.       prefix = 0;
           ^
191.       i = prefix + 1;
192.       while (i <= len) {

test/handshake_helper.c:190:5: Assignment
188.       memcpy(*out + 1, protos, len);
189.   
190.       prefix = 0;
           ^
191.       i = prefix + 1;
192.       while (i <= len) {

test/handshake_helper.c:194:13: Binary operation: ([0, protos->strlen - 1] - [0, max(2, protos->strlen)]):unsigned64
192.       while (i <= len) {
193.           if ((*out)[i] == ',') {
194.               TEST_check(i - 1 - prefix > 0);
                   ^
195.               (*out)[prefix] = i - 1 - prefix;
196.               prefix = i;

static void parse_protos(const char *protos, unsigned char **out, size_t *outlen)
{
    size_t len, i, prefix;
    len = strlen(protos);
    TEST_check(*out == NULL);
    *out = OPENSSL_malloc(len + 1);
    TEST_check(*out != NULL);
    *outlen = len + 1;
    memcpy(*out + 1, protos, len);
    prefix = 0;
    i = prefix + 1;
    while (i <= len) {
        if ((*out)[i] == ',') {
            TEST_check(i - 1 - prefix > 0);
            (*out)[prefix] = i - 1 - prefix;
            prefix = i;
        }
        i++;
    }
    TEST_check(len - prefix > 0);
    (*out)[prefix] = len - prefix;
}
["static void parse_protos(const char *protos, unsigned char **out, size_t *outlen)\n{\n    size_t len, i, prefix;\n    len = strlen(protos);\n    TEST_check(*out == NULL);\n    *out = OPENSSL_malloc(len + 1);\n    TEST_check(*out != NULL);\n    *outlen = len + 1;\n    memcpy(*out + 1, protos, len);\n    prefix = 0;\n    i = prefix + 1;\n    while (i <= len) {\n        if ((*out)[i] == ',') {\n            TEST_check(i - 1 - prefix > 0);\n            (*out)[prefix] = i - 1 - prefix;\n            prefix = i;\n        }\n        i++;\n    }\n    TEST_check(len - prefix > 0);\n    (*out)[prefix] = len - prefix;\n}"]