Lines Matching refs:p

28 	if (UNEXPECTED((size_t)(p - begin) > packet->header.size)) { \
96 const zend_uchar *p= (const zend_uchar *)*packet; in php_mysqlnd_net_field_length() local
98 if (*p < 251) { in php_mysqlnd_net_field_length()
100 return (zend_ulong) *p; in php_mysqlnd_net_field_length()
103 switch (*p) { in php_mysqlnd_net_field_length()
109 return (zend_ulong) uint2korr(p+1); in php_mysqlnd_net_field_length()
112 return (zend_ulong) uint3korr(p+1); in php_mysqlnd_net_field_length()
115 return (zend_ulong) uint4korr(p+1); in php_mysqlnd_net_field_length()
126 const zend_uchar *p = (zend_uchar *)*packet; in php_mysqlnd_net_field_length_ll() local
128 if (*p < 251) { in php_mysqlnd_net_field_length_ll()
130 return (uint64_t) *p; in php_mysqlnd_net_field_length_ll()
133 switch (*p) { in php_mysqlnd_net_field_length_ll()
139 return (uint64_t) uint2korr(p + 1); in php_mysqlnd_net_field_length_ll()
142 return (uint64_t) uint3korr(p + 1); in php_mysqlnd_net_field_length_ll()
145 return (uint64_t) uint8korr(p + 1); in php_mysqlnd_net_field_length_ll()
202 const zend_uchar *p = buf; in php_mysqlnd_read_error_from_line() local
211 *error_no = uint2korr(p); in php_mysqlnd_read_error_from_line()
212 p+= 2; in php_mysqlnd_read_error_from_line()
217 if (*p == '#') { in php_mysqlnd_read_error_from_line()
218 ++p; in php_mysqlnd_read_error_from_line()
219 if ((buf_len - (p - buf)) >= MYSQLND_SQLSTATE_LENGTH) { in php_mysqlnd_read_error_from_line()
220 memcpy(sqlstate, p, MYSQLND_SQLSTATE_LENGTH); in php_mysqlnd_read_error_from_line()
221 p+= MYSQLND_SQLSTATE_LENGTH; in php_mysqlnd_read_error_from_line()
226 if ((buf_len - (p - buf)) > 0) { in php_mysqlnd_read_error_from_line()
227 error_msg_len = MIN((int)((buf_len - (p - buf))), (int) (error_buf_len - 1)); in php_mysqlnd_read_error_from_line()
228 memcpy(error, p, error_msg_len); in php_mysqlnd_read_error_from_line()
350 const zend_uchar * p = buf; in php_mysqlnd_greet_read() local
363 packet->protocol_version = uint1korr(p); in php_mysqlnd_greet_read()
364 p++; in php_mysqlnd_greet_read()
368 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_greet_read()
385 if (!strncmp((char *) p, MARIADB_RPL_VERSION_HACK, sizeof(MARIADB_RPL_VERSION_HACK) - 1)) { in php_mysqlnd_greet_read()
386 p += sizeof(MARIADB_RPL_VERSION_HACK) - 1; in php_mysqlnd_greet_read()
389 packet->server_version = estrdup((char *)p); in php_mysqlnd_greet_read()
390 p+= strlen(packet->server_version) + 1; /* eat the '\0' */ in php_mysqlnd_greet_read()
393 packet->thread_id = uint4korr(p); in php_mysqlnd_greet_read()
394 p+=4; in php_mysqlnd_greet_read()
397 memcpy(packet->authentication_plugin_data.s, p, SCRAMBLE_LENGTH_323); in php_mysqlnd_greet_read()
398 p+= SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
402 p++; in php_mysqlnd_greet_read()
405 packet->server_capabilities = uint2korr(p); in php_mysqlnd_greet_read()
406 p+= 2; in php_mysqlnd_greet_read()
410 packet->charset_no = uint1korr(p); in php_mysqlnd_greet_read()
411 p++; in php_mysqlnd_greet_read()
414 packet->server_status = uint2korr(p); in php_mysqlnd_greet_read()
415 p+= 2; in php_mysqlnd_greet_read()
419 pad_start = p; in php_mysqlnd_greet_read()
420 p+= 13; in php_mysqlnd_greet_read()
423 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
425 …memcpy(packet->authentication_plugin_data.s + SCRAMBLE_LENGTH_323, p, SCRAMBLE_LENGTH - SCRAMBLE_L… in php_mysqlnd_greet_read()
426 p+= SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
427 p++; /* 0x0 at the end of the scramble and thus last byte in the packet in 5.1 and previous */ in php_mysqlnd_greet_read()
433 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
435 p--; in php_mysqlnd_greet_read()
449 …memcpy(new_auth_plugin_data + SCRAMBLE_LENGTH, p, packet->authentication_plugin_data.l - SCRAMBLE_… in php_mysqlnd_greet_read()
450 p+= (packet->authentication_plugin_data.l - SCRAMBLE_LENGTH); in php_mysqlnd_greet_read()
458 size_t remaining_size = packet->header.size - (size_t)(p - buf); in php_mysqlnd_greet_read()
464 char *null_terminator = memchr(p, '\0', remaining_size); in php_mysqlnd_greet_read()
468 auth_protocol_len = null_terminator - (char *)p; in php_mysqlnd_greet_read()
474 memcpy(auth_protocol, p, auth_protocol_len); in php_mysqlnd_greet_read()
478 p += auth_protocol_len; in php_mysqlnd_greet_read()
480 p++; in php_mysqlnd_greet_read()
494 DBG_ERR_FMT("GREET packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_greet_read()
496 p - begin - packet->header.size); in php_mysqlnd_greet_read()
506 MYSQLND_PACKET_GREET *p= (MYSQLND_PACKET_GREET *) _packet; in php_mysqlnd_greet_free_mem() local
507 if (p->server_version) { in php_mysqlnd_greet_free_mem()
508 efree(p->server_version); in php_mysqlnd_greet_free_mem()
509 p->server_version = NULL; in php_mysqlnd_greet_free_mem()
511 …if (p->authentication_plugin_data.s && p->authentication_plugin_data.s != p->intern_auth_plugin_da… in php_mysqlnd_greet_free_mem()
512 efree(p->authentication_plugin_data.s); in php_mysqlnd_greet_free_mem()
513 p->authentication_plugin_data.s = NULL; in php_mysqlnd_greet_free_mem()
515 if (p->auth_protocol) { in php_mysqlnd_greet_free_mem()
516 efree(p->auth_protocol); in php_mysqlnd_greet_free_mem()
517 p->auth_protocol = NULL; in php_mysqlnd_greet_free_mem()
530 zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_auth_write() local
542 int4store(p, packet->client_flags); in php_mysqlnd_auth_write()
543 p+= 4; in php_mysqlnd_auth_write()
545 int4store(p, packet->max_packet_size); in php_mysqlnd_auth_write()
546 p+= 4; in php_mysqlnd_auth_write()
548 int1store(p, packet->charset_no); in php_mysqlnd_auth_write()
549 p++; in php_mysqlnd_auth_write()
551 memset(p, 0, 23); /* filler */ in php_mysqlnd_auth_write()
552 p+= 23; in php_mysqlnd_auth_write()
557 p = zend_mempcpy(p, packet->user, len); in php_mysqlnd_auth_write()
558 *p++ = '\0'; in php_mysqlnd_auth_write()
572 int1store(p, (int8_t)packet->auth_data_len); in php_mysqlnd_auth_write()
573 ++p; in php_mysqlnd_auth_write()
575 if (sizeof(buffer) < (packet->auth_data_len + (p - buffer))) { in php_mysqlnd_auth_write()
580 p = zend_mempcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_auth_write()
586 p = zend_mempcpy(p, packet->db, real_db_len); in php_mysqlnd_auth_write()
587 *p++= '\0'; in php_mysqlnd_auth_write()
589 *p++= '\0'; in php_mysqlnd_auth_write()
595 int2store(p, packet->charset_no); in php_mysqlnd_auth_write()
596 p+= 2; in php_mysqlnd_auth_write()
601 len = MIN(strlen(packet->auth_plugin_name), sizeof(buffer) - (p - buffer) - 1); in php_mysqlnd_auth_write()
602 p = zend_mempcpy(p, packet->auth_plugin_name, len); in php_mysqlnd_auth_write()
603 *p++= '\0'; in php_mysqlnd_auth_write()
624 …if (sizeof(buffer) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len) + (p - b… in php_mysqlnd_auth_write()
625 p = php_mysqlnd_net_store_length(p, ca_payload_len); in php_mysqlnd_auth_write()
635 p = php_mysqlnd_net_store_length(p, ZSTR_LEN(key)); in php_mysqlnd_auth_write()
636 p = zend_mempcpy(p, ZSTR_VAL(key), ZSTR_LEN(key)); in php_mysqlnd_auth_write()
638 p = php_mysqlnd_net_store_length(p, value_len); in php_mysqlnd_auth_write()
639 p = zend_mempcpy(p, Z_STRVAL_P(entry_value), value_len); in php_mysqlnd_auth_write()
650 …const MYSQLND_CSTRING payload = {(char*) buffer + MYSQLND_HEADER_SIZE, p - (buffer + MYSQLND_HEADE… in php_mysqlnd_auth_write()
654 DBG_RETURN(ret == PASS? (p - buffer - MYSQLND_HEADER_SIZE) : 0); in php_mysqlnd_auth_write()
660 …const size_t sent = pfc->data->m.send(pfc, vio, buffer, p - buffer - MYSQLND_HEADER_SIZE, stats, e… in php_mysqlnd_auth_write()
682 const zend_uchar * p = buf; in php_mysqlnd_auth_response_read() local
693 packet->response_code = uint1korr(p); in php_mysqlnd_auth_response_read()
694 p++; in php_mysqlnd_auth_response_read()
698 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_auth_response_read()
706 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_auth_response_read()
707 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_auth_response_read()
709 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_auth_response_read()
711 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_auth_response_read()
714 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_auth_response_read()
722 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
725 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
728 packet->server_status = uint2korr(p); in php_mysqlnd_auth_response_read()
729 p+= 2; in php_mysqlnd_auth_response_read()
732 packet->warning_count = uint2korr(p); in php_mysqlnd_auth_response_read()
733 p+= 2; in php_mysqlnd_auth_response_read()
737 if (packet->header.size > (size_t) (p - buf) && (net_len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_auth_response_read()
740 if ((p - buf) > packet->header.size || packet->header.size - (p - buf) < net_len) { in php_mysqlnd_auth_response_read()
746 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_auth_response_read()
759 DBG_ERR_FMT("OK packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
761 p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
771 MYSQLND_PACKET_AUTH_RESPONSE * p = (MYSQLND_PACKET_AUTH_RESPONSE *) _packet; in php_mysqlnd_auth_response_free_mem() local
772 if (p->message) { in php_mysqlnd_auth_response_free_mem()
773 mnd_efree(p->message); in php_mysqlnd_auth_response_free_mem()
774 p->message = NULL; in php_mysqlnd_auth_response_free_mem()
776 if (p->new_auth_protocol) { in php_mysqlnd_auth_response_free_mem()
777 mnd_efree(p->new_auth_protocol); in php_mysqlnd_auth_response_free_mem()
778 p->new_auth_protocol = NULL; in php_mysqlnd_auth_response_free_mem()
780 p->new_auth_protocol_len = 0; in php_mysqlnd_auth_response_free_mem()
782 if (p->new_auth_protocol_data) { in php_mysqlnd_auth_response_free_mem()
783 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_auth_response_free_mem()
784 p->new_auth_protocol_data = NULL; in php_mysqlnd_auth_response_free_mem()
786 p->new_auth_protocol_data_len = 0; in php_mysqlnd_auth_response_free_mem()
803 zend_uchar * p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_change_auth_response_write() local
808 p = zend_mempcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_change_auth_response_write()
816 …const size_t sent = pfc->data->m.send(pfc, vio, buffer, p - buffer - MYSQLND_HEADER_SIZE, stats, e… in php_mysqlnd_change_auth_response_write()
841 const zend_uchar * p = buf; in php_mysqlnd_ok_read() local
853 packet->field_count = uint1korr(p); in php_mysqlnd_ok_read()
854 p++; in php_mysqlnd_ok_read()
858 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_ok_read()
865 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
868 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
871 packet->server_status = uint2korr(p); in php_mysqlnd_ok_read()
872 p+= 2; in php_mysqlnd_ok_read()
875 packet->warning_count = uint2korr(p); in php_mysqlnd_ok_read()
876 p+= 2; in php_mysqlnd_ok_read()
880 if (packet->header.size > (size_t) (p - buf) && (net_len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_ok_read()
881 packet->message_len = MIN(net_len, buf_len - (p - begin)); in php_mysqlnd_ok_read()
882 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_ok_read()
896 DBG_ERR_FMT("OK packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_ok_read()
898 p - begin - packet->header.size); in php_mysqlnd_ok_read()
908 MYSQLND_PACKET_OK *p= (MYSQLND_PACKET_OK *) _packet; in php_mysqlnd_ok_free_mem() local
909 if (p->message) { in php_mysqlnd_ok_free_mem()
910 mnd_efree(p->message); in php_mysqlnd_ok_free_mem()
911 p->message = NULL; in php_mysqlnd_ok_free_mem()
935 const zend_uchar * p = buf; in php_mysqlnd_eof_read() local
946 packet->field_count = uint1korr(p); in php_mysqlnd_eof_read()
947 p++; in php_mysqlnd_eof_read()
951 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_eof_read()
964 packet->warning_count = uint2korr(p); in php_mysqlnd_eof_read()
965 p+= 2; in php_mysqlnd_eof_read()
968 packet->server_status = uint2korr(p); in php_mysqlnd_eof_read()
969 p+= 2; in php_mysqlnd_eof_read()
983 DBG_ERR_FMT("EOF packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_eof_read()
985 p - begin - packet->header.size); in php_mysqlnd_eof_read()
1023 zend_uchar *tmp, *p; in php_mysqlnd_cmd_write() local
1028 p = tmp + MYSQLND_HEADER_SIZE; /* skip the header */ in php_mysqlnd_cmd_write()
1030 int1store(p, packet->command); in php_mysqlnd_cmd_write()
1031 p++; in php_mysqlnd_cmd_write()
1033 memcpy(p, packet->argument.s, packet->argument.l); in php_mysqlnd_cmd_write()
1063 const zend_uchar * p = buf; in php_mysqlnd_rset_header_read() local
1078 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_header_read()
1080 p++; in php_mysqlnd_rset_header_read()
1082 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_header_read()
1089 packet->field_count = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rset_header_read()
1104 memcpy(packet->info_or_local_file.s, p, len); in php_mysqlnd_rset_header_read()
1110 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1113 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1116 packet->server_status = uint2korr(p); in php_mysqlnd_rset_header_read()
1117 p+=2; in php_mysqlnd_rset_header_read()
1120 packet->warning_count = uint2korr(p); in php_mysqlnd_rset_header_read()
1121 p+=2; in php_mysqlnd_rset_header_read()
1124 if (packet->header.size > (size_t) (p - buf) && (len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_rset_header_read()
1127 if ((p - buf) > packet->header.size || packet->header.size - (p - buf) < len) { in php_mysqlnd_rset_header_read()
1128 size_t local_file_name_over_read = ((p - buf) - packet->header.size) + len; in php_mysqlnd_rset_header_read()
1137 memcpy(packet->info_or_local_file.s, p, len); in php_mysqlnd_rset_header_read()
1154 DBG_ERR_FMT("RSET_HEADER packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1156 p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1166 MYSQLND_PACKET_RSET_HEADER *p= (MYSQLND_PACKET_RSET_HEADER *) _packet; in php_mysqlnd_rset_header_free_mem() local
1168 mysqlnd_set_string(&p->info_or_local_file, NULL, 0); in php_mysqlnd_rset_header_free_mem()
1174 len = php_mysqlnd_net_field_length(&p); \
1178 meta->field_name = (const char *)p; \
1180 p += len; \
1203 const zend_uchar * p = buf; in php_mysqlnd_rset_field_read() local
1220 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_field_read()
1222 p++; in php_mysqlnd_rset_field_read()
1224 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_field_read()
1230 } else if (EODATA_MARKER == *p && packet->header.size < 8) { in php_mysqlnd_rset_field_read()
1247 if (UNEXPECTED(12 != *p)) { in php_mysqlnd_rset_field_read()
1248 DBG_ERR_FMT("Protocol error. Server sent false length. Expected 12 got %d", (int) *p); in php_mysqlnd_rset_field_read()
1252 if ((size_t)((p - begin) + 12) > packet->header.size) { in php_mysqlnd_rset_field_read()
1257 p++; in php_mysqlnd_rset_field_read()
1259 meta->charsetnr = uint2korr(p); in php_mysqlnd_rset_field_read()
1260 p += 2; in php_mysqlnd_rset_field_read()
1262 meta->length = uint4korr(p); in php_mysqlnd_rset_field_read()
1263 p += 4; in php_mysqlnd_rset_field_read()
1265 meta->type = uint1korr(p); in php_mysqlnd_rset_field_read()
1266 p += 1; in php_mysqlnd_rset_field_read()
1268 meta->flags = uint2korr(p); in php_mysqlnd_rset_field_read()
1269 p += 2; in php_mysqlnd_rset_field_read()
1271 meta->decimals = uint1korr(p); in php_mysqlnd_rset_field_read()
1272 p += 1; in php_mysqlnd_rset_field_read()
1275 p +=2; in php_mysqlnd_rset_field_read()
1287 if (packet->header.size > (size_t) (p - buf) && in php_mysqlnd_rset_field_read()
1288 (len = php_mysqlnd_net_field_length(&p)) && in php_mysqlnd_rset_field_read()
1357 DBG_ERR_FMT("RSET field packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1359 "shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1387 zend_uchar * p = NULL; in php_mysqlnd_read_row_ex() local
1417 p = buf + *data_size; in php_mysqlnd_read_row_ex()
1420 …if (UNEXPECTED(PASS != (ret = pfc->data->m.receive(pfc, vio, p, header.size, stats, error_info))))… in php_mysqlnd_read_row_ex()
1438 p = (zend_uchar *) buffer->ptr + *data_size; in php_mysqlnd_read_row_ex()
1441 …if (UNEXPECTED(PASS != (ret = pfc->data->m.receive(pfc, vio, p, header.size, stats, error_info))))… in php_mysqlnd_read_row_ex()
1461 const zend_uchar * p = rbp; in php_mysqlnd_rowp_read_binary_protocol() local
1475 p++; in php_mysqlnd_rowp_read_binary_protocol()
1476 null_ptr= p; in php_mysqlnd_rowp_read_binary_protocol()
1477 p += (field_count + 9)/8; /* skip null bits */ in php_mysqlnd_rowp_read_binary_protocol()
1482 const zend_uchar * orig_p = p; in php_mysqlnd_rowp_read_binary_protocol()
1494 size_t row_position = p - rbp; in php_mysqlnd_rowp_read_binary_protocol()
1502 … mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], rbs - row_position, &p); in php_mysqlnd_rowp_read_binary_protocol()
1503 if (p == NULL) { in php_mysqlnd_rowp_read_binary_protocol()
1547 Z_STRLEN_P(current_field) : (size_t)(p - orig_p)); in php_mysqlnd_rowp_read_binary_protocol()
1568 zend_uchar * p = row_buffer->ptr; in php_mysqlnd_rowp_read_text_protocol() local
1570 const zend_uchar * const packet_end = (zend_uchar*) p + data_size; in php_mysqlnd_rowp_read_text_protocol()
1582 const zend_ulong len = php_mysqlnd_net_field_length((const zend_uchar **) &p); in php_mysqlnd_rowp_read_text_protocol()
1587 } else if (p > packet_end || len > packet_end - p) { in php_mysqlnd_rowp_read_text_protocol()
1637 …ps_fetch_from_1_to_8_bytes(current_field, &(fields_metadata[i]), 0, (const zend_uchar **) &p, len); in php_mysqlnd_rowp_read_text_protocol()
1642 p -= len; in php_mysqlnd_rowp_read_text_protocol()
1653 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol()
1655 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol()
1660 atoll((char *) p); in php_mysqlnd_rowp_read_text_protocol()
1662 _atoi64((char *) p); in php_mysqlnd_rowp_read_text_protocol()
1668 strtoull((char *) p, NULL, 10); in php_mysqlnd_rowp_read_text_protocol()
1670 _strtoui64((char *) p, NULL, 10); in php_mysqlnd_rowp_read_text_protocol()
1684 ZVAL_STRINGL(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol()
1689 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol()
1691 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol()
1693 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol()
1694 ZVAL_DOUBLE(current_field, zend_strtod((char *) p, NULL)); in php_mysqlnd_rowp_read_text_protocol()
1695 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol()
1697 ZVAL_STRINGL_FAST(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol()
1699 p += len; in php_mysqlnd_rowp_read_text_protocol()
1717 zend_uchar *p; in php_mysqlnd_rowp_read() local
1745 if (ERROR_MARKER == (*(p = packet->row_buffer.ptr))) { in php_mysqlnd_rowp_read()
1752 php_mysqlnd_read_error_from_line(p + 1, data_size - 1, in php_mysqlnd_rowp_read()
1758 } else if (EODATA_MARKER == *p && data_size < 8) { /* EOF */ in php_mysqlnd_rowp_read()
1760 p++; in php_mysqlnd_rowp_read()
1762 packet->warning_count = uint2korr(p); in php_mysqlnd_rowp_read()
1763 p += 2; in php_mysqlnd_rowp_read()
1764 packet->server_status = uint2korr(p); in php_mysqlnd_rowp_read()
1814 MYSQLND_PACKET_STATS *p= (MYSQLND_PACKET_STATS *) _packet; in php_mysqlnd_stats_free_mem() local
1815 mysqlnd_set_string(&p->message, NULL, 0); in php_mysqlnd_stats_free_mem()
1837 zend_uchar *p = buf; in php_mysqlnd_prepare_read() local
1849 packet->error_code = uint1korr(p); in php_mysqlnd_prepare_read()
1850 p++; in php_mysqlnd_prepare_read()
1854 php_mysqlnd_read_error_from_line(p, data_size - 1, in php_mysqlnd_prepare_read()
1871 packet->stmt_id = uint4korr(p); in php_mysqlnd_prepare_read()
1872 p += 4; in php_mysqlnd_prepare_read()
1876 packet->field_count = uint2korr(p); in php_mysqlnd_prepare_read()
1877 p += 2; in php_mysqlnd_prepare_read()
1880 packet->param_count = uint2korr(p); in php_mysqlnd_prepare_read()
1881 p += 2; in php_mysqlnd_prepare_read()
1886 p++; in php_mysqlnd_prepare_read()
1889 packet->warning_count = uint2korr(p); in php_mysqlnd_prepare_read()
1899 DBG_ERR_FMT("PREPARE packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_prepare_read()
1901 p - begin - packet->header.size); in php_mysqlnd_prepare_read()
1920 zend_uchar *p = buf; in php_mysqlnd_chg_user_read() local
1936 packet->response_code = uint1korr(p); in php_mysqlnd_chg_user_read()
1937 p++; in php_mysqlnd_chg_user_read()
1946 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_chg_user_read()
1954 if (packet->response_code == 0xFE && packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_chg_user_read()
1955 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_chg_user_read()
1957 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_chg_user_read()
1958 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_chg_user_read()
1961 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_chg_user_read()
1969 DBG_ERR_FMT("CHANGE_USER packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
1971 p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
1981 MYSQLND_PACKET_CHG_USER_RESPONSE * p = (MYSQLND_PACKET_CHG_USER_RESPONSE *) _packet; in php_mysqlnd_chg_user_free_mem() local
1983 if (p->new_auth_protocol) { in php_mysqlnd_chg_user_free_mem()
1984 mnd_efree(p->new_auth_protocol); in php_mysqlnd_chg_user_free_mem()
1985 p->new_auth_protocol = NULL; in php_mysqlnd_chg_user_free_mem()
1987 p->new_auth_protocol_len = 0; in php_mysqlnd_chg_user_free_mem()
1989 if (p->new_auth_protocol_data) { in php_mysqlnd_chg_user_free_mem()
1990 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_chg_user_free_mem()
1991 p->new_auth_protocol_data = NULL; in php_mysqlnd_chg_user_free_mem()
1993 p->new_auth_protocol_data_len = 0; in php_mysqlnd_chg_user_free_mem()
2031 const zend_uchar * p = buf; in php_mysqlnd_sha256_pk_request_response_read() local
2042 p++; in php_mysqlnd_sha256_pk_request_response_read()
2045 packet->public_key_len = packet->header.size - (p - buf); in php_mysqlnd_sha256_pk_request_response_read()
2047 memcpy(packet->public_key, p, packet->public_key_len); in php_mysqlnd_sha256_pk_request_response_read()
2053 DBG_ERR_FMT("OK packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2055 p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2065 …MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * p = (MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE *) _pac… in php_mysqlnd_sha256_pk_request_response_free_mem() local
2066 if (p->public_key) { in php_mysqlnd_sha256_pk_request_response_free_mem()
2067 mnd_efree(p->public_key); in php_mysqlnd_sha256_pk_request_response_free_mem()
2068 p->public_key = NULL; in php_mysqlnd_sha256_pk_request_response_free_mem()
2070 p->public_key_len = 0; in php_mysqlnd_sha256_pk_request_response_free_mem()
2113 const zend_uchar * p = buf; in php_mysqlnd_cached_sha2_result_read() local
2122 packet->response_code = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2123 p++; in php_mysqlnd_cached_sha2_result_read()
2127 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_cached_sha2_result_read()
2135 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_cached_sha2_result_read()
2136 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_cached_sha2_result_read()
2138 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_cached_sha2_result_read()
2140 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_cached_sha2_result_read()
2143 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_cached_sha2_result_read()
2156 packet->response_code = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2157 p++; in php_mysqlnd_cached_sha2_result_read()
2160 packet->result = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2166 DBG_ERR_FMT("OK packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_cached_sha2_result_read()
2168 p - begin - packet->header.size); in php_mysqlnd_cached_sha2_result_read()