Lines Matching refs:p
28 if (UNEXPECTED((size_t)(p - begin) > packet->header.size)) { \
96 register 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 register 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()
327 const zend_uchar * p = buf; in php_mysqlnd_greet_read() local
355 packet->protocol_version = uint1korr(p); in php_mysqlnd_greet_read()
356 p++; in php_mysqlnd_greet_read()
360 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_greet_read()
377 if (!strncmp((char *) p, MARIADB_RPL_VERSION_HACK, sizeof(MARIADB_RPL_VERSION_HACK) - 1)) { in php_mysqlnd_greet_read()
378 p += sizeof(MARIADB_RPL_VERSION_HACK) - 1; in php_mysqlnd_greet_read()
381 packet->server_version = estrdup((char *)p); in php_mysqlnd_greet_read()
382 p+= strlen(packet->server_version) + 1; /* eat the '\0' */ in php_mysqlnd_greet_read()
385 packet->thread_id = uint4korr(p); in php_mysqlnd_greet_read()
386 p+=4; in php_mysqlnd_greet_read()
389 memcpy(packet->authentication_plugin_data.s, p, SCRAMBLE_LENGTH_323); in php_mysqlnd_greet_read()
390 p+= SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
394 p++; in php_mysqlnd_greet_read()
397 packet->server_capabilities = uint2korr(p); in php_mysqlnd_greet_read()
398 p+= 2; in php_mysqlnd_greet_read()
402 packet->charset_no = uint1korr(p); in php_mysqlnd_greet_read()
403 p++; in php_mysqlnd_greet_read()
406 packet->server_status = uint2korr(p); in php_mysqlnd_greet_read()
407 p+= 2; in php_mysqlnd_greet_read()
411 pad_start = p; in php_mysqlnd_greet_read()
412 p+= 13; in php_mysqlnd_greet_read()
415 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
417 …memcpy(packet->authentication_plugin_data.s + SCRAMBLE_LENGTH_323, p, SCRAMBLE_LENGTH - SCRAMBLE_L… in php_mysqlnd_greet_read()
418 p+= SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
419 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()
425 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
427 p--; in php_mysqlnd_greet_read()
441 …memcpy(new_auth_plugin_data + SCRAMBLE_LENGTH, p, packet->authentication_plugin_data.l - SCRAMBLE_… in php_mysqlnd_greet_read()
442 p+= (packet->authentication_plugin_data.l - SCRAMBLE_LENGTH); in php_mysqlnd_greet_read()
450 packet->auth_protocol = estrdup((char *)p); in php_mysqlnd_greet_read()
451 p+= strlen(packet->auth_protocol) + 1; /* eat the '\0' */ in php_mysqlnd_greet_read()
463 DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_greet_read()
465 p - begin - packet->header.size); in php_mysqlnd_greet_read()
475 MYSQLND_PACKET_GREET *p= (MYSQLND_PACKET_GREET *) _packet; in php_mysqlnd_greet_free_mem() local
476 if (p->server_version) { in php_mysqlnd_greet_free_mem()
477 efree(p->server_version); in php_mysqlnd_greet_free_mem()
478 p->server_version = NULL; in php_mysqlnd_greet_free_mem()
480 …if (p->authentication_plugin_data.s && p->authentication_plugin_data.s != p->intern_auth_plugin_da… in php_mysqlnd_greet_free_mem()
481 efree(p->authentication_plugin_data.s); in php_mysqlnd_greet_free_mem()
482 p->authentication_plugin_data.s = NULL; in php_mysqlnd_greet_free_mem()
484 if (p->auth_protocol) { in php_mysqlnd_greet_free_mem()
485 efree(p->auth_protocol); in php_mysqlnd_greet_free_mem()
486 p->auth_protocol = NULL; in php_mysqlnd_greet_free_mem()
499 zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_auth_write() local
511 int4store(p, packet->client_flags); in php_mysqlnd_auth_write()
512 p+= 4; in php_mysqlnd_auth_write()
514 int4store(p, packet->max_packet_size); in php_mysqlnd_auth_write()
515 p+= 4; in php_mysqlnd_auth_write()
517 int1store(p, packet->charset_no); in php_mysqlnd_auth_write()
518 p++; in php_mysqlnd_auth_write()
520 memset(p, 0, 23); /* filler */ in php_mysqlnd_auth_write()
521 p+= 23; in php_mysqlnd_auth_write()
526 memcpy(p, packet->user, len); in php_mysqlnd_auth_write()
527 p+= len; in php_mysqlnd_auth_write()
528 *p++ = '\0'; in php_mysqlnd_auth_write()
542 int1store(p, (int8_t)packet->auth_data_len); in php_mysqlnd_auth_write()
543 ++p; in php_mysqlnd_auth_write()
545 if (sizeof(buffer) < (packet->auth_data_len + (p - buffer))) { in php_mysqlnd_auth_write()
550 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_auth_write()
551 p+= packet->auth_data_len; in php_mysqlnd_auth_write()
557 memcpy(p, packet->db, real_db_len); in php_mysqlnd_auth_write()
558 p+= real_db_len; in php_mysqlnd_auth_write()
559 *p++= '\0'; in php_mysqlnd_auth_write()
561 *p++= '\0'; in php_mysqlnd_auth_write()
567 int2store(p, packet->charset_no); in php_mysqlnd_auth_write()
568 p+= 2; in php_mysqlnd_auth_write()
573 len = MIN(strlen(packet->auth_plugin_name), sizeof(buffer) - (p - buffer) - 1); in php_mysqlnd_auth_write()
574 memcpy(p, packet->auth_plugin_name, len); in php_mysqlnd_auth_write()
575 p+= len; in php_mysqlnd_auth_write()
576 *p++= '\0'; in php_mysqlnd_auth_write()
597 …if (sizeof(buffer) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len) + (p - b… in php_mysqlnd_auth_write()
598 p = php_mysqlnd_net_store_length(p, ca_payload_len); in php_mysqlnd_auth_write()
608 p = php_mysqlnd_net_store_length(p, ZSTR_LEN(key)); in php_mysqlnd_auth_write()
609 memcpy(p, ZSTR_VAL(key), ZSTR_LEN(key)); in php_mysqlnd_auth_write()
610 p+= ZSTR_LEN(key); in php_mysqlnd_auth_write()
612 p = php_mysqlnd_net_store_length(p, value_len); in php_mysqlnd_auth_write()
613 memcpy(p, Z_STRVAL_P(entry_value), value_len); in php_mysqlnd_auth_write()
614 p+= value_len; in php_mysqlnd_auth_write()
625 …const MYSQLND_CSTRING payload = {(char*) buffer + MYSQLND_HEADER_SIZE, p - (buffer + MYSQLND_HEADE… in php_mysqlnd_auth_write()
629 DBG_RETURN(ret == PASS? (p - buffer - MYSQLND_HEADER_SIZE) : 0); in php_mysqlnd_auth_write()
635 …const size_t sent = pfc->data->m.send(pfc, vio, buffer, p - buffer - MYSQLND_HEADER_SIZE, stats, e… in php_mysqlnd_auth_write()
660 const zend_uchar * p = buf; in php_mysqlnd_auth_response_read() local
679 packet->response_code = uint1korr(p); in php_mysqlnd_auth_response_read()
680 p++; in php_mysqlnd_auth_response_read()
684 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_auth_response_read()
692 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_auth_response_read()
693 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_auth_response_read()
695 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_auth_response_read()
697 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_auth_response_read()
700 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_auth_response_read()
708 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
711 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
714 packet->server_status = uint2korr(p); in php_mysqlnd_auth_response_read()
715 p+= 2; in php_mysqlnd_auth_response_read()
718 packet->warning_count = uint2korr(p); in php_mysqlnd_auth_response_read()
719 p+= 2; in php_mysqlnd_auth_response_read()
723 if (packet->header.size > (size_t) (p - buf) && (net_len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_auth_response_read()
724 packet->message_len = MIN(net_len, buf_len - (p - begin)); in php_mysqlnd_auth_response_read()
725 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_auth_response_read()
738 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
740 p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
750 MYSQLND_PACKET_AUTH_RESPONSE * p = (MYSQLND_PACKET_AUTH_RESPONSE *) _packet; in php_mysqlnd_auth_response_free_mem() local
751 if (p->message) { in php_mysqlnd_auth_response_free_mem()
752 mnd_efree(p->message); in php_mysqlnd_auth_response_free_mem()
753 p->message = NULL; in php_mysqlnd_auth_response_free_mem()
755 if (p->new_auth_protocol) { in php_mysqlnd_auth_response_free_mem()
756 mnd_efree(p->new_auth_protocol); in php_mysqlnd_auth_response_free_mem()
757 p->new_auth_protocol = NULL; in php_mysqlnd_auth_response_free_mem()
759 p->new_auth_protocol_len = 0; in php_mysqlnd_auth_response_free_mem()
761 if (p->new_auth_protocol_data) { in php_mysqlnd_auth_response_free_mem()
762 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_auth_response_free_mem()
763 p->new_auth_protocol_data = NULL; in php_mysqlnd_auth_response_free_mem()
765 p->new_auth_protocol_data_len = 0; in php_mysqlnd_auth_response_free_mem()
782 zend_uchar * p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_change_auth_response_write() local
787 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_change_auth_response_write()
788 p+= packet->auth_data_len; in php_mysqlnd_change_auth_response_write()
796 …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()
824 const zend_uchar * p = buf; in php_mysqlnd_ok_read() local
836 packet->field_count = uint1korr(p); in php_mysqlnd_ok_read()
837 p++; in php_mysqlnd_ok_read()
841 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_ok_read()
848 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
851 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
854 packet->server_status = uint2korr(p); in php_mysqlnd_ok_read()
855 p+= 2; in php_mysqlnd_ok_read()
858 packet->warning_count = uint2korr(p); in php_mysqlnd_ok_read()
859 p+= 2; in php_mysqlnd_ok_read()
863 if (packet->header.size > (size_t) (p - buf) && (net_len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_ok_read()
864 packet->message_len = MIN(net_len, buf_len - (p - begin)); in php_mysqlnd_ok_read()
865 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_ok_read()
879 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_ok_read()
881 p - begin - packet->header.size); in php_mysqlnd_ok_read()
891 MYSQLND_PACKET_OK *p= (MYSQLND_PACKET_OK *) _packet; in php_mysqlnd_ok_free_mem() local
892 if (p->message) { in php_mysqlnd_ok_free_mem()
893 mnd_efree(p->message); in php_mysqlnd_ok_free_mem()
894 p->message = NULL; in php_mysqlnd_ok_free_mem()
918 const zend_uchar * p = buf; in php_mysqlnd_eof_read() local
929 packet->field_count = uint1korr(p); in php_mysqlnd_eof_read()
930 p++; in php_mysqlnd_eof_read()
934 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_eof_read()
947 packet->warning_count = uint2korr(p); in php_mysqlnd_eof_read()
948 p+= 2; in php_mysqlnd_eof_read()
951 packet->server_status = uint2korr(p); in php_mysqlnd_eof_read()
952 p+= 2; in php_mysqlnd_eof_read()
966 DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_eof_read()
968 p - begin - packet->header.size); in php_mysqlnd_eof_read()
1006 zend_uchar *tmp, *p; in php_mysqlnd_cmd_write() local
1011 p = tmp + MYSQLND_HEADER_SIZE; /* skip the header */ in php_mysqlnd_cmd_write()
1013 int1store(p, packet->command); in php_mysqlnd_cmd_write()
1014 p++; in php_mysqlnd_cmd_write()
1016 memcpy(p, packet->argument.s, packet->argument.l); in php_mysqlnd_cmd_write()
1046 const zend_uchar * p = buf; in php_mysqlnd_rset_header_read() local
1061 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_header_read()
1063 p++; in php_mysqlnd_rset_header_read()
1065 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_header_read()
1072 packet->field_count = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rset_header_read()
1088 memcpy(packet->info_or_local_file.s, p, len); in php_mysqlnd_rset_header_read()
1098 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1101 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1104 packet->server_status = uint2korr(p); in php_mysqlnd_rset_header_read()
1105 p+=2; in php_mysqlnd_rset_header_read()
1108 packet->warning_count = uint2korr(p); in php_mysqlnd_rset_header_read()
1109 p+=2; in php_mysqlnd_rset_header_read()
1112 if (packet->header.size > (size_t) (p - buf) && (len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_rset_header_read()
1115 memcpy(packet->info_or_local_file.s, p, len); in php_mysqlnd_rset_header_read()
1136 DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1138 p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1148 MYSQLND_PACKET_RSET_HEADER *p= (MYSQLND_PACKET_RSET_HEADER *) _packet; in php_mysqlnd_rset_header_free_mem() local
1150 if (p->info_or_local_file.s) { in php_mysqlnd_rset_header_free_mem()
1151 mnd_efree(p->info_or_local_file.s); in php_mysqlnd_rset_header_free_mem()
1152 p->info_or_local_file.s = NULL; in php_mysqlnd_rset_header_free_mem()
1159 len = php_mysqlnd_net_field_length(&p); \
1163 meta->field_name = (const char *)p; \
1165 p += len; \
1188 const zend_uchar * p = buf; in php_mysqlnd_rset_field_read() local
1205 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_field_read()
1207 p++; in php_mysqlnd_rset_field_read()
1209 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_field_read()
1215 } else if (EODATA_MARKER == *p && packet->header.size < 8) { in php_mysqlnd_rset_field_read()
1232 if (UNEXPECTED(12 != *p)) { in php_mysqlnd_rset_field_read()
1233 DBG_ERR_FMT("Protocol error. Server sent false length. Expected 12 got %d", (int) *p); in php_mysqlnd_rset_field_read()
1237 if ((size_t)((p - begin) + 12) > packet->header.size) { in php_mysqlnd_rset_field_read()
1242 p++; in php_mysqlnd_rset_field_read()
1244 meta->charsetnr = uint2korr(p); in php_mysqlnd_rset_field_read()
1245 p += 2; in php_mysqlnd_rset_field_read()
1247 meta->length = uint4korr(p); in php_mysqlnd_rset_field_read()
1248 p += 4; in php_mysqlnd_rset_field_read()
1250 meta->type = uint1korr(p); in php_mysqlnd_rset_field_read()
1251 p += 1; in php_mysqlnd_rset_field_read()
1253 meta->flags = uint2korr(p); in php_mysqlnd_rset_field_read()
1254 p += 2; in php_mysqlnd_rset_field_read()
1256 meta->decimals = uint1korr(p); in php_mysqlnd_rset_field_read()
1257 p += 1; in php_mysqlnd_rset_field_read()
1260 p +=2; in php_mysqlnd_rset_field_read()
1277 if (packet->header.size > (size_t) (p - buf) && in php_mysqlnd_rset_field_read()
1278 (len = php_mysqlnd_net_field_length(&p)) && in php_mysqlnd_rset_field_read()
1284 memcpy(meta->def, p, len); in php_mysqlnd_rset_field_read()
1287 p += len; in php_mysqlnd_rset_field_read()
1349 DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1351 "shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1379 zend_uchar * p = NULL; in php_mysqlnd_read_row_ex() local
1409 p = buf + *data_size; in php_mysqlnd_read_row_ex()
1412 …if (UNEXPECTED(PASS != (ret = pfc->data->m.receive(pfc, vio, p, header.size, stats, error_info))))… in php_mysqlnd_read_row_ex()
1430 p = (zend_uchar *) buffer->ptr + *data_size; in php_mysqlnd_read_row_ex()
1433 …if (UNEXPECTED(PASS != (ret = pfc->data->m.receive(pfc, vio, p, header.size, stats, error_info))))… in php_mysqlnd_read_row_ex()
1455 const zend_uchar * p = row_buffer->ptr; in php_mysqlnd_rowp_read_binary_protocol() local
1469 p++; in php_mysqlnd_rowp_read_binary_protocol()
1470 null_ptr= p; in php_mysqlnd_rowp_read_binary_protocol()
1471 p += (field_count + 9)/8; /* skip null bits */ in php_mysqlnd_rowp_read_binary_protocol()
1476 const zend_uchar * orig_p = p; in php_mysqlnd_rowp_read_binary_protocol()
1488 mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], 0, &p); in php_mysqlnd_rowp_read_binary_protocol()
1526 Z_STRLEN_P(current_field) : (size_t)(p - orig_p)); in php_mysqlnd_rowp_read_binary_protocol()
1547 zend_uchar * p = row_buffer->ptr; in php_mysqlnd_rowp_read_text_protocol_aux() local
1549 const zend_uchar * const packet_end = (zend_uchar*) p + data_size; in php_mysqlnd_rowp_read_text_protocol_aux()
1561 const zend_ulong len = php_mysqlnd_net_field_length((const zend_uchar **) &p); in php_mysqlnd_rowp_read_text_protocol_aux()
1566 } else if ((p + len) > packet_end) { in php_mysqlnd_rowp_read_text_protocol_aux()
1568 " bytes after end of packet", (p + len) - packet_end - 1); in php_mysqlnd_rowp_read_text_protocol_aux()
1615 …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_aux()
1620 p -= len; in php_mysqlnd_rowp_read_text_protocol_aux()
1632 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol_aux()
1634 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol_aux()
1639 atoll((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1641 _atoi64((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1647 strtoull((char *) p, NULL, 10); in php_mysqlnd_rowp_read_text_protocol_aux()
1649 _strtoui64((char *) p, NULL, 10); in php_mysqlnd_rowp_read_text_protocol_aux()
1663 ZVAL_STRINGL(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol_aux()
1668 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol_aux()
1670 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol_aux()
1672 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol_aux()
1673 ZVAL_DOUBLE(current_field, zend_strtod((char *) p, NULL)); in php_mysqlnd_rowp_read_text_protocol_aux()
1674 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol_aux()
1678 ZVAL_STRINGL_FAST(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol_aux()
1680 p += len; in php_mysqlnd_rowp_read_text_protocol_aux()
1730 zend_uchar *p; in php_mysqlnd_rowp_read() local
1758 if (ERROR_MARKER == (*(p = packet->row_buffer.ptr))) { in php_mysqlnd_rowp_read()
1765 php_mysqlnd_read_error_from_line(p + 1, data_size - 1, in php_mysqlnd_rowp_read()
1771 } else if (EODATA_MARKER == *p && data_size < 8) { /* EOF */ in php_mysqlnd_rowp_read()
1773 p++; in php_mysqlnd_rowp_read()
1775 packet->warning_count = uint2korr(p); in php_mysqlnd_rowp_read()
1776 p += 2; in php_mysqlnd_rowp_read()
1777 packet->server_status = uint2korr(p); in php_mysqlnd_rowp_read()
1821 MYSQLND_PACKET_ROW *p; in php_mysqlnd_rowp_free_mem() local
1824 p = (MYSQLND_PACKET_ROW *) _packet; in php_mysqlnd_rowp_free_mem()
1825 if (p->row_buffer.ptr) { in php_mysqlnd_rowp_free_mem()
1826 p->result_set_memory_pool->free_chunk(p->result_set_memory_pool, p->row_buffer.ptr); in php_mysqlnd_rowp_free_mem()
1827 p->row_buffer.ptr = NULL; in php_mysqlnd_rowp_free_mem()
1874 MYSQLND_PACKET_STATS *p= (MYSQLND_PACKET_STATS *) _packet; in php_mysqlnd_stats_free_mem() local
1875 if (p->message.s) { in php_mysqlnd_stats_free_mem()
1876 mnd_efree(p->message.s); in php_mysqlnd_stats_free_mem()
1877 p->message.s = NULL; in php_mysqlnd_stats_free_mem()
1900 zend_uchar *p = buf; in php_mysqlnd_prepare_read() local
1912 packet->error_code = uint1korr(p); in php_mysqlnd_prepare_read()
1913 p++; in php_mysqlnd_prepare_read()
1917 php_mysqlnd_read_error_from_line(p, data_size - 1, in php_mysqlnd_prepare_read()
1934 packet->stmt_id = uint4korr(p); in php_mysqlnd_prepare_read()
1935 p += 4; in php_mysqlnd_prepare_read()
1939 packet->field_count = uint2korr(p); in php_mysqlnd_prepare_read()
1940 p += 2; in php_mysqlnd_prepare_read()
1943 packet->param_count = uint2korr(p); in php_mysqlnd_prepare_read()
1944 p += 2; in php_mysqlnd_prepare_read()
1949 p++; in php_mysqlnd_prepare_read()
1952 packet->warning_count = uint2korr(p); in php_mysqlnd_prepare_read()
1962 DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_prepare_read()
1964 p - begin - packet->header.size); in php_mysqlnd_prepare_read()
1983 zend_uchar *p = buf; in php_mysqlnd_chg_user_read() local
1999 packet->response_code = uint1korr(p); in php_mysqlnd_chg_user_read()
2000 p++; in php_mysqlnd_chg_user_read()
2009 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_chg_user_read()
2017 if (packet->response_code == 0xFE && packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_chg_user_read()
2018 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_chg_user_read()
2020 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_chg_user_read()
2021 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_chg_user_read()
2024 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_chg_user_read()
2032 DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
2034 p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
2044 MYSQLND_PACKET_CHG_USER_RESPONSE * p = (MYSQLND_PACKET_CHG_USER_RESPONSE *) _packet; in php_mysqlnd_chg_user_free_mem() local
2046 if (p->new_auth_protocol) { in php_mysqlnd_chg_user_free_mem()
2047 mnd_efree(p->new_auth_protocol); in php_mysqlnd_chg_user_free_mem()
2048 p->new_auth_protocol = NULL; in php_mysqlnd_chg_user_free_mem()
2050 p->new_auth_protocol_len = 0; in php_mysqlnd_chg_user_free_mem()
2052 if (p->new_auth_protocol_data) { in php_mysqlnd_chg_user_free_mem()
2053 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_chg_user_free_mem()
2054 p->new_auth_protocol_data = NULL; in php_mysqlnd_chg_user_free_mem()
2056 p->new_auth_protocol_data_len = 0; in php_mysqlnd_chg_user_free_mem()
2095 zend_uchar *p = buf; in php_mysqlnd_sha256_pk_request_response_read() local
2106 p++; in php_mysqlnd_sha256_pk_request_response_read()
2109 packet->public_key_len = packet->header.size - (p - buf); in php_mysqlnd_sha256_pk_request_response_read()
2111 memcpy(packet->public_key, p, packet->public_key_len); in php_mysqlnd_sha256_pk_request_response_read()
2117 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2119 p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2129 …MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * p = (MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE *) _pac… in php_mysqlnd_sha256_pk_request_response_free_mem() local
2130 if (p->public_key) { in php_mysqlnd_sha256_pk_request_response_free_mem()
2131 mnd_efree(p->public_key); in php_mysqlnd_sha256_pk_request_response_free_mem()
2132 p->public_key = NULL; in php_mysqlnd_sha256_pk_request_response_free_mem()
2134 p->public_key_len = 0; in php_mysqlnd_sha256_pk_request_response_free_mem()
2176 zend_uchar *p = buf; in php_mysqlnd_cached_sha2_result_read() local
2185 packet->response_code = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2186 p++; in php_mysqlnd_cached_sha2_result_read()
2190 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_cached_sha2_result_read()
2198 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_cached_sha2_result_read()
2199 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_cached_sha2_result_read()
2201 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_cached_sha2_result_read()
2203 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_cached_sha2_result_read()
2206 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_cached_sha2_result_read()
2219 packet->response_code = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2220 p++; in php_mysqlnd_cached_sha2_result_read()
2223 packet->result = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2229 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_cached_sha2_result_read()
2231 p - begin - packet->header.size); in php_mysqlnd_cached_sha2_result_read()