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()
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 size_t remaining_size = packet->header.size - (size_t)(p - buf); in php_mysqlnd_greet_read()
456 char *null_terminator = memchr(p, '\0', remaining_size); in php_mysqlnd_greet_read()
460 auth_protocol_len = null_terminator - (char *)p; in php_mysqlnd_greet_read()
466 memcpy(auth_protocol, p, auth_protocol_len); in php_mysqlnd_greet_read()
470 p += auth_protocol_len; in php_mysqlnd_greet_read()
472 p++; in php_mysqlnd_greet_read()
486 DBG_ERR_FMT("GREET packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_greet_read()
488 p - begin - packet->header.size); in php_mysqlnd_greet_read()
498 MYSQLND_PACKET_GREET *p= (MYSQLND_PACKET_GREET *) _packet; in php_mysqlnd_greet_free_mem() local
499 if (p->server_version) { in php_mysqlnd_greet_free_mem()
500 efree(p->server_version); in php_mysqlnd_greet_free_mem()
501 p->server_version = NULL; in php_mysqlnd_greet_free_mem()
503 …if (p->authentication_plugin_data.s && p->authentication_plugin_data.s != p->intern_auth_plugin_da… in php_mysqlnd_greet_free_mem()
504 efree(p->authentication_plugin_data.s); in php_mysqlnd_greet_free_mem()
505 p->authentication_plugin_data.s = NULL; in php_mysqlnd_greet_free_mem()
507 if (p->auth_protocol) { in php_mysqlnd_greet_free_mem()
508 efree(p->auth_protocol); in php_mysqlnd_greet_free_mem()
509 p->auth_protocol = NULL; in php_mysqlnd_greet_free_mem()
522 zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_auth_write() local
534 int4store(p, packet->client_flags); in php_mysqlnd_auth_write()
535 p+= 4; in php_mysqlnd_auth_write()
537 int4store(p, packet->max_packet_size); in php_mysqlnd_auth_write()
538 p+= 4; in php_mysqlnd_auth_write()
540 int1store(p, packet->charset_no); in php_mysqlnd_auth_write()
541 p++; in php_mysqlnd_auth_write()
543 memset(p, 0, 23); /* filler */ in php_mysqlnd_auth_write()
544 p+= 23; in php_mysqlnd_auth_write()
549 memcpy(p, packet->user, len); in php_mysqlnd_auth_write()
550 p+= len; in php_mysqlnd_auth_write()
551 *p++ = '\0'; in php_mysqlnd_auth_write()
565 int1store(p, (int8_t)packet->auth_data_len); in php_mysqlnd_auth_write()
566 ++p; in php_mysqlnd_auth_write()
568 if (sizeof(buffer) < (packet->auth_data_len + (p - buffer))) { in php_mysqlnd_auth_write()
573 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_auth_write()
574 p+= packet->auth_data_len; in php_mysqlnd_auth_write()
580 memcpy(p, packet->db, real_db_len); in php_mysqlnd_auth_write()
581 p+= real_db_len; in php_mysqlnd_auth_write()
582 *p++= '\0'; in php_mysqlnd_auth_write()
584 *p++= '\0'; in php_mysqlnd_auth_write()
590 int2store(p, packet->charset_no); in php_mysqlnd_auth_write()
591 p+= 2; in php_mysqlnd_auth_write()
596 len = MIN(strlen(packet->auth_plugin_name), sizeof(buffer) - (p - buffer) - 1); in php_mysqlnd_auth_write()
597 memcpy(p, packet->auth_plugin_name, len); in php_mysqlnd_auth_write()
598 p+= len; in php_mysqlnd_auth_write()
599 *p++= '\0'; in php_mysqlnd_auth_write()
620 …if (sizeof(buffer) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len) + (p - b… in php_mysqlnd_auth_write()
621 p = php_mysqlnd_net_store_length(p, ca_payload_len); in php_mysqlnd_auth_write()
631 p = php_mysqlnd_net_store_length(p, ZSTR_LEN(key)); in php_mysqlnd_auth_write()
632 memcpy(p, ZSTR_VAL(key), ZSTR_LEN(key)); in php_mysqlnd_auth_write()
633 p+= ZSTR_LEN(key); in php_mysqlnd_auth_write()
635 p = php_mysqlnd_net_store_length(p, value_len); in php_mysqlnd_auth_write()
636 memcpy(p, Z_STRVAL_P(entry_value), value_len); in php_mysqlnd_auth_write()
637 p+= value_len; in php_mysqlnd_auth_write()
648 …const MYSQLND_CSTRING payload = {(char*) buffer + MYSQLND_HEADER_SIZE, p - (buffer + MYSQLND_HEADE… in php_mysqlnd_auth_write()
652 DBG_RETURN(ret == PASS? (p - buffer - MYSQLND_HEADER_SIZE) : 0); in php_mysqlnd_auth_write()
658 …const size_t sent = pfc->data->m.send(pfc, vio, buffer, p - buffer - MYSQLND_HEADER_SIZE, stats, e… in php_mysqlnd_auth_write()
683 const zend_uchar * p = buf; in php_mysqlnd_auth_response_read() local
702 packet->response_code = uint1korr(p); in php_mysqlnd_auth_response_read()
703 p++; in php_mysqlnd_auth_response_read()
707 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_auth_response_read()
715 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_auth_response_read()
716 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_auth_response_read()
718 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_auth_response_read()
720 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_auth_response_read()
723 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_auth_response_read()
731 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
734 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
737 packet->server_status = uint2korr(p); in php_mysqlnd_auth_response_read()
738 p+= 2; in php_mysqlnd_auth_response_read()
741 packet->warning_count = uint2korr(p); in php_mysqlnd_auth_response_read()
742 p+= 2; in php_mysqlnd_auth_response_read()
746 if (packet->header.size > (size_t) (p - buf) && (net_len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_auth_response_read()
749 if ((p - buf) > packet->header.size || packet->header.size - (p - buf) < net_len) { in php_mysqlnd_auth_response_read()
755 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_auth_response_read()
768 DBG_ERR_FMT("OK packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
770 p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
780 MYSQLND_PACKET_AUTH_RESPONSE * p = (MYSQLND_PACKET_AUTH_RESPONSE *) _packet; in php_mysqlnd_auth_response_free_mem() local
781 if (p->message) { in php_mysqlnd_auth_response_free_mem()
782 mnd_efree(p->message); in php_mysqlnd_auth_response_free_mem()
783 p->message = NULL; in php_mysqlnd_auth_response_free_mem()
785 if (p->new_auth_protocol) { in php_mysqlnd_auth_response_free_mem()
786 mnd_efree(p->new_auth_protocol); in php_mysqlnd_auth_response_free_mem()
787 p->new_auth_protocol = NULL; in php_mysqlnd_auth_response_free_mem()
789 p->new_auth_protocol_len = 0; in php_mysqlnd_auth_response_free_mem()
791 if (p->new_auth_protocol_data) { in php_mysqlnd_auth_response_free_mem()
792 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_auth_response_free_mem()
793 p->new_auth_protocol_data = NULL; in php_mysqlnd_auth_response_free_mem()
795 p->new_auth_protocol_data_len = 0; in php_mysqlnd_auth_response_free_mem()
812 zend_uchar * p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_change_auth_response_write() local
817 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_change_auth_response_write()
818 p+= packet->auth_data_len; in php_mysqlnd_change_auth_response_write()
826 …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()
854 const zend_uchar * p = buf; in php_mysqlnd_ok_read() local
866 packet->field_count = uint1korr(p); in php_mysqlnd_ok_read()
867 p++; in php_mysqlnd_ok_read()
871 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_ok_read()
878 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
881 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
884 packet->server_status = uint2korr(p); in php_mysqlnd_ok_read()
885 p+= 2; in php_mysqlnd_ok_read()
888 packet->warning_count = uint2korr(p); in php_mysqlnd_ok_read()
889 p+= 2; in php_mysqlnd_ok_read()
893 if (packet->header.size > (size_t) (p - buf) && (net_len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_ok_read()
894 packet->message_len = MIN(net_len, buf_len - (p - begin)); in php_mysqlnd_ok_read()
895 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_ok_read()
909 DBG_ERR_FMT("OK packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_ok_read()
911 p - begin - packet->header.size); in php_mysqlnd_ok_read()
921 MYSQLND_PACKET_OK *p= (MYSQLND_PACKET_OK *) _packet; in php_mysqlnd_ok_free_mem() local
922 if (p->message) { in php_mysqlnd_ok_free_mem()
923 mnd_efree(p->message); in php_mysqlnd_ok_free_mem()
924 p->message = NULL; in php_mysqlnd_ok_free_mem()
948 const zend_uchar * p = buf; in php_mysqlnd_eof_read() local
959 packet->field_count = uint1korr(p); in php_mysqlnd_eof_read()
960 p++; in php_mysqlnd_eof_read()
964 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_eof_read()
977 packet->warning_count = uint2korr(p); in php_mysqlnd_eof_read()
978 p+= 2; in php_mysqlnd_eof_read()
981 packet->server_status = uint2korr(p); in php_mysqlnd_eof_read()
982 p+= 2; in php_mysqlnd_eof_read()
996 DBG_ERR_FMT("EOF packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_eof_read()
998 p - begin - packet->header.size); in php_mysqlnd_eof_read()
1036 zend_uchar *tmp, *p; in php_mysqlnd_cmd_write() local
1041 p = tmp + MYSQLND_HEADER_SIZE; /* skip the header */ in php_mysqlnd_cmd_write()
1043 int1store(p, packet->command); in php_mysqlnd_cmd_write()
1044 p++; in php_mysqlnd_cmd_write()
1046 memcpy(p, packet->argument.s, packet->argument.l); in php_mysqlnd_cmd_write()
1076 const zend_uchar * p = buf; in php_mysqlnd_rset_header_read() local
1091 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_header_read()
1093 p++; in php_mysqlnd_rset_header_read()
1095 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_header_read()
1102 packet->field_count = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rset_header_read()
1117 memcpy(packet->info_or_local_file.s, p, len); in php_mysqlnd_rset_header_read()
1123 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1126 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1129 packet->server_status = uint2korr(p); in php_mysqlnd_rset_header_read()
1130 p+=2; in php_mysqlnd_rset_header_read()
1133 packet->warning_count = uint2korr(p); in php_mysqlnd_rset_header_read()
1134 p+=2; in php_mysqlnd_rset_header_read()
1137 if (packet->header.size > (size_t) (p - buf) && (len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_rset_header_read()
1140 if ((p - buf) > packet->header.size || packet->header.size - (p - buf) < len) { in php_mysqlnd_rset_header_read()
1141 size_t local_file_name_over_read = ((p - buf) - packet->header.size) + len; in php_mysqlnd_rset_header_read()
1150 memcpy(packet->info_or_local_file.s, p, len); in php_mysqlnd_rset_header_read()
1167 DBG_ERR_FMT("RSET_HEADER packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1169 p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1179 MYSQLND_PACKET_RSET_HEADER *p= (MYSQLND_PACKET_RSET_HEADER *) _packet; in php_mysqlnd_rset_header_free_mem() local
1181 mysqlnd_set_string(&p->info_or_local_file, NULL, 0); in php_mysqlnd_rset_header_free_mem()
1187 len = php_mysqlnd_net_field_length(&p); \
1191 meta->field_name = (const char *)p; \
1193 p += len; \
1216 const zend_uchar * p = buf; in php_mysqlnd_rset_field_read() local
1233 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_field_read()
1235 p++; in php_mysqlnd_rset_field_read()
1237 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_field_read()
1243 } else if (EODATA_MARKER == *p && packet->header.size < 8) { in php_mysqlnd_rset_field_read()
1260 if (UNEXPECTED(12 != *p)) { in php_mysqlnd_rset_field_read()
1261 DBG_ERR_FMT("Protocol error. Server sent false length. Expected 12 got %d", (int) *p); in php_mysqlnd_rset_field_read()
1265 if ((size_t)((p - begin) + 12) > packet->header.size) { in php_mysqlnd_rset_field_read()
1270 p++; in php_mysqlnd_rset_field_read()
1272 meta->charsetnr = uint2korr(p); in php_mysqlnd_rset_field_read()
1273 p += 2; in php_mysqlnd_rset_field_read()
1275 meta->length = uint4korr(p); in php_mysqlnd_rset_field_read()
1276 p += 4; in php_mysqlnd_rset_field_read()
1278 meta->type = uint1korr(p); in php_mysqlnd_rset_field_read()
1279 p += 1; in php_mysqlnd_rset_field_read()
1281 meta->flags = uint2korr(p); in php_mysqlnd_rset_field_read()
1282 p += 2; in php_mysqlnd_rset_field_read()
1284 meta->decimals = uint1korr(p); in php_mysqlnd_rset_field_read()
1285 p += 1; in php_mysqlnd_rset_field_read()
1288 p +=2; in php_mysqlnd_rset_field_read()
1300 if (packet->header.size > (size_t) (p - buf) && in php_mysqlnd_rset_field_read()
1301 (len = php_mysqlnd_net_field_length(&p)) && in php_mysqlnd_rset_field_read()
1370 DBG_ERR_FMT("RSET field packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1372 "shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1400 zend_uchar * p = NULL; in php_mysqlnd_read_row_ex() local
1430 p = buf + *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()
1451 p = (zend_uchar *) buffer->ptr + *data_size; in php_mysqlnd_read_row_ex()
1454 …if (UNEXPECTED(PASS != (ret = pfc->data->m.receive(pfc, vio, p, header.size, stats, error_info))))… in php_mysqlnd_read_row_ex()
1474 const zend_uchar * p = rbp; in php_mysqlnd_rowp_read_binary_protocol() local
1488 p++; in php_mysqlnd_rowp_read_binary_protocol()
1489 null_ptr= p; in php_mysqlnd_rowp_read_binary_protocol()
1490 p += (field_count + 9)/8; /* skip null bits */ in php_mysqlnd_rowp_read_binary_protocol()
1495 const zend_uchar * orig_p = p; in php_mysqlnd_rowp_read_binary_protocol()
1507 size_t row_position = p - rbp; in php_mysqlnd_rowp_read_binary_protocol()
1515 … mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], rbs - row_position, &p); in php_mysqlnd_rowp_read_binary_protocol()
1516 if (p == NULL) { in php_mysqlnd_rowp_read_binary_protocol()
1559 Z_STRLEN_P(current_field) : (size_t)(p - orig_p)); in php_mysqlnd_rowp_read_binary_protocol()
1580 zend_uchar * p = row_buffer->ptr; in php_mysqlnd_rowp_read_text_protocol() local
1582 const zend_uchar * const packet_end = (zend_uchar*) p + data_size; in php_mysqlnd_rowp_read_text_protocol()
1594 const zend_ulong len = php_mysqlnd_net_field_length((const zend_uchar **) &p); in php_mysqlnd_rowp_read_text_protocol()
1599 } else if (p > packet_end || len > packet_end - p) { in php_mysqlnd_rowp_read_text_protocol()
1648 …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()
1653 p -= len; in php_mysqlnd_rowp_read_text_protocol()
1664 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol()
1666 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol()
1671 atoll((char *) p); in php_mysqlnd_rowp_read_text_protocol()
1673 _atoi64((char *) p); in php_mysqlnd_rowp_read_text_protocol()
1679 strtoull((char *) p, NULL, 10); in php_mysqlnd_rowp_read_text_protocol()
1681 _strtoui64((char *) p, NULL, 10); in php_mysqlnd_rowp_read_text_protocol()
1695 ZVAL_STRINGL(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol()
1700 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol()
1702 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol()
1704 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol()
1705 ZVAL_DOUBLE(current_field, zend_strtod((char *) p, NULL)); in php_mysqlnd_rowp_read_text_protocol()
1706 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol()
1708 ZVAL_STRINGL_FAST(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol()
1710 p += len; in php_mysqlnd_rowp_read_text_protocol()
1728 zend_uchar *p; in php_mysqlnd_rowp_read() local
1756 if (ERROR_MARKER == (*(p = packet->row_buffer.ptr))) { in php_mysqlnd_rowp_read()
1763 php_mysqlnd_read_error_from_line(p + 1, data_size - 1, in php_mysqlnd_rowp_read()
1769 } else if (EODATA_MARKER == *p && data_size < 8) { /* EOF */ in php_mysqlnd_rowp_read()
1771 p++; in php_mysqlnd_rowp_read()
1773 packet->warning_count = uint2korr(p); in php_mysqlnd_rowp_read()
1774 p += 2; in php_mysqlnd_rowp_read()
1775 packet->server_status = uint2korr(p); in php_mysqlnd_rowp_read()
1825 MYSQLND_PACKET_STATS *p= (MYSQLND_PACKET_STATS *) _packet; in php_mysqlnd_stats_free_mem() local
1826 mysqlnd_set_string(&p->message, NULL, 0); in php_mysqlnd_stats_free_mem()
1848 zend_uchar *p = buf; in php_mysqlnd_prepare_read() local
1860 packet->error_code = uint1korr(p); in php_mysqlnd_prepare_read()
1861 p++; in php_mysqlnd_prepare_read()
1865 php_mysqlnd_read_error_from_line(p, data_size - 1, in php_mysqlnd_prepare_read()
1882 packet->stmt_id = uint4korr(p); in php_mysqlnd_prepare_read()
1883 p += 4; in php_mysqlnd_prepare_read()
1887 packet->field_count = uint2korr(p); in php_mysqlnd_prepare_read()
1888 p += 2; in php_mysqlnd_prepare_read()
1891 packet->param_count = uint2korr(p); in php_mysqlnd_prepare_read()
1892 p += 2; in php_mysqlnd_prepare_read()
1897 p++; in php_mysqlnd_prepare_read()
1900 packet->warning_count = uint2korr(p); in php_mysqlnd_prepare_read()
1910 DBG_ERR_FMT("PREPARE packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_prepare_read()
1912 p - begin - packet->header.size); in php_mysqlnd_prepare_read()
1931 zend_uchar *p = buf; in php_mysqlnd_chg_user_read() local
1947 packet->response_code = uint1korr(p); in php_mysqlnd_chg_user_read()
1948 p++; in php_mysqlnd_chg_user_read()
1957 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_chg_user_read()
1965 if (packet->response_code == 0xFE && packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_chg_user_read()
1966 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_chg_user_read()
1968 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_chg_user_read()
1969 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_chg_user_read()
1972 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_chg_user_read()
1980 DBG_ERR_FMT("CHANGE_USER packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
1982 p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
1992 MYSQLND_PACKET_CHG_USER_RESPONSE * p = (MYSQLND_PACKET_CHG_USER_RESPONSE *) _packet; in php_mysqlnd_chg_user_free_mem() local
1994 if (p->new_auth_protocol) { in php_mysqlnd_chg_user_free_mem()
1995 mnd_efree(p->new_auth_protocol); in php_mysqlnd_chg_user_free_mem()
1996 p->new_auth_protocol = NULL; in php_mysqlnd_chg_user_free_mem()
1998 p->new_auth_protocol_len = 0; in php_mysqlnd_chg_user_free_mem()
2000 if (p->new_auth_protocol_data) { in php_mysqlnd_chg_user_free_mem()
2001 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_chg_user_free_mem()
2002 p->new_auth_protocol_data = NULL; in php_mysqlnd_chg_user_free_mem()
2004 p->new_auth_protocol_data_len = 0; in php_mysqlnd_chg_user_free_mem()
2043 zend_uchar *p = buf; in php_mysqlnd_sha256_pk_request_response_read() local
2054 p++; in php_mysqlnd_sha256_pk_request_response_read()
2057 packet->public_key_len = packet->header.size - (p - buf); in php_mysqlnd_sha256_pk_request_response_read()
2059 memcpy(packet->public_key, p, packet->public_key_len); in php_mysqlnd_sha256_pk_request_response_read()
2065 DBG_ERR_FMT("OK packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2067 p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2077 …MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * p = (MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE *) _pac… in php_mysqlnd_sha256_pk_request_response_free_mem() local
2078 if (p->public_key) { in php_mysqlnd_sha256_pk_request_response_free_mem()
2079 mnd_efree(p->public_key); in php_mysqlnd_sha256_pk_request_response_free_mem()
2080 p->public_key = NULL; in php_mysqlnd_sha256_pk_request_response_free_mem()
2082 p->public_key_len = 0; in php_mysqlnd_sha256_pk_request_response_free_mem()
2124 zend_uchar *p = buf; in php_mysqlnd_cached_sha2_result_read() local
2133 packet->response_code = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2134 p++; in php_mysqlnd_cached_sha2_result_read()
2138 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_cached_sha2_result_read()
2146 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_cached_sha2_result_read()
2147 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_cached_sha2_result_read()
2149 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_cached_sha2_result_read()
2151 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_cached_sha2_result_read()
2154 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_cached_sha2_result_read()
2167 packet->response_code = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2168 p++; in php_mysqlnd_cached_sha2_result_read()
2171 packet->result = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2177 DBG_ERR_FMT("OK packet %zu bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_cached_sha2_result_read()
2179 p - begin - packet->header.size); in php_mysqlnd_cached_sha2_result_read()