Lines Matching refs:p
30 if (UNEXPECTED((size_t)(p - begin) > packet->header.size)) { \
97 register const zend_uchar *p= (const zend_uchar *)*packet; in php_mysqlnd_net_field_length() local
99 if (*p < 251) { in php_mysqlnd_net_field_length()
101 return (zend_ulong) *p; in php_mysqlnd_net_field_length()
104 switch (*p) { in php_mysqlnd_net_field_length()
110 return (zend_ulong) uint2korr(p+1); in php_mysqlnd_net_field_length()
113 return (zend_ulong) uint3korr(p+1); in php_mysqlnd_net_field_length()
116 return (zend_ulong) uint4korr(p+1); in php_mysqlnd_net_field_length()
127 register const zend_uchar *p = (zend_uchar *)*packet; in php_mysqlnd_net_field_length_ll() local
129 if (*p < 251) { in php_mysqlnd_net_field_length_ll()
131 return (uint64_t) *p; in php_mysqlnd_net_field_length_ll()
134 switch (*p) { in php_mysqlnd_net_field_length_ll()
140 return (uint64_t) uint2korr(p + 1); in php_mysqlnd_net_field_length_ll()
143 return (uint64_t) uint3korr(p + 1); in php_mysqlnd_net_field_length_ll()
146 return (uint64_t) uint8korr(p + 1); in php_mysqlnd_net_field_length_ll()
203 const zend_uchar *p = buf; in php_mysqlnd_read_error_from_line() local
212 *error_no = uint2korr(p); in php_mysqlnd_read_error_from_line()
213 p+= 2; in php_mysqlnd_read_error_from_line()
218 if (*p == '#') { in php_mysqlnd_read_error_from_line()
219 ++p; in php_mysqlnd_read_error_from_line()
220 if ((buf_len - (p - buf)) >= MYSQLND_SQLSTATE_LENGTH) { in php_mysqlnd_read_error_from_line()
221 memcpy(sqlstate, p, MYSQLND_SQLSTATE_LENGTH); in php_mysqlnd_read_error_from_line()
222 p+= MYSQLND_SQLSTATE_LENGTH; in php_mysqlnd_read_error_from_line()
227 if ((buf_len - (p - buf)) > 0) { in php_mysqlnd_read_error_from_line()
228 error_msg_len = MIN((int)((buf_len - (p - buf))), (int) (error_buf_len - 1)); in php_mysqlnd_read_error_from_line()
229 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()
375 packet->server_version = estrdup((char *)p); in php_mysqlnd_greet_read()
376 p+= strlen(packet->server_version) + 1; /* eat the '\0' */ in php_mysqlnd_greet_read()
379 packet->thread_id = uint4korr(p); in php_mysqlnd_greet_read()
380 p+=4; in php_mysqlnd_greet_read()
383 memcpy(packet->authentication_plugin_data.s, p, SCRAMBLE_LENGTH_323); in php_mysqlnd_greet_read()
384 p+= SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
388 p++; in php_mysqlnd_greet_read()
391 packet->server_capabilities = uint2korr(p); in php_mysqlnd_greet_read()
392 p+= 2; in php_mysqlnd_greet_read()
396 packet->charset_no = uint1korr(p); in php_mysqlnd_greet_read()
397 p++; in php_mysqlnd_greet_read()
400 packet->server_status = uint2korr(p); in php_mysqlnd_greet_read()
401 p+= 2; in php_mysqlnd_greet_read()
405 pad_start = p; in php_mysqlnd_greet_read()
406 p+= 13; in php_mysqlnd_greet_read()
409 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
411 …memcpy(packet->authentication_plugin_data.s + SCRAMBLE_LENGTH_323, p, SCRAMBLE_LENGTH - SCRAMBLE_L… in php_mysqlnd_greet_read()
412 p+= SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323; in php_mysqlnd_greet_read()
413 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()
419 if ((size_t) (p - buf) < packet->header.size) { in php_mysqlnd_greet_read()
421 p--; in php_mysqlnd_greet_read()
435 …memcpy(new_auth_plugin_data + SCRAMBLE_LENGTH, p, packet->authentication_plugin_data.l - SCRAMBLE_… in php_mysqlnd_greet_read()
436 p+= (packet->authentication_plugin_data.l - SCRAMBLE_LENGTH); in php_mysqlnd_greet_read()
444 packet->auth_protocol = estrdup((char *)p); in php_mysqlnd_greet_read()
445 p+= strlen(packet->auth_protocol) + 1; /* eat the '\0' */ in php_mysqlnd_greet_read()
457 DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_greet_read()
459 p - begin - packet->header.size); in php_mysqlnd_greet_read()
469 MYSQLND_PACKET_GREET *p= (MYSQLND_PACKET_GREET *) _packet; in php_mysqlnd_greet_free_mem() local
470 if (p->server_version) { in php_mysqlnd_greet_free_mem()
471 efree(p->server_version); in php_mysqlnd_greet_free_mem()
472 p->server_version = NULL; in php_mysqlnd_greet_free_mem()
474 …if (p->authentication_plugin_data.s && p->authentication_plugin_data.s != p->intern_auth_plugin_da… in php_mysqlnd_greet_free_mem()
475 efree(p->authentication_plugin_data.s); in php_mysqlnd_greet_free_mem()
476 p->authentication_plugin_data.s = NULL; in php_mysqlnd_greet_free_mem()
478 if (p->auth_protocol) { in php_mysqlnd_greet_free_mem()
479 efree(p->auth_protocol); in php_mysqlnd_greet_free_mem()
480 p->auth_protocol = NULL; in php_mysqlnd_greet_free_mem()
493 zend_uchar *p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_auth_write() local
505 int4store(p, packet->client_flags); in php_mysqlnd_auth_write()
506 p+= 4; in php_mysqlnd_auth_write()
508 int4store(p, packet->max_packet_size); in php_mysqlnd_auth_write()
509 p+= 4; in php_mysqlnd_auth_write()
511 int1store(p, packet->charset_no); in php_mysqlnd_auth_write()
512 p++; in php_mysqlnd_auth_write()
514 memset(p, 0, 23); /* filler */ in php_mysqlnd_auth_write()
515 p+= 23; in php_mysqlnd_auth_write()
520 memcpy(p, packet->user, len); in php_mysqlnd_auth_write()
521 p+= len; in php_mysqlnd_auth_write()
522 *p++ = '\0'; in php_mysqlnd_auth_write()
536 int1store(p, (int8_t)packet->auth_data_len); in php_mysqlnd_auth_write()
537 ++p; in php_mysqlnd_auth_write()
539 if (sizeof(buffer) < (packet->auth_data_len + (p - buffer))) { in php_mysqlnd_auth_write()
544 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_auth_write()
545 p+= packet->auth_data_len; in php_mysqlnd_auth_write()
551 memcpy(p, packet->db, real_db_len); in php_mysqlnd_auth_write()
552 p+= real_db_len; in php_mysqlnd_auth_write()
553 *p++= '\0'; in php_mysqlnd_auth_write()
555 *p++= '\0'; in php_mysqlnd_auth_write()
561 int2store(p, packet->charset_no); in php_mysqlnd_auth_write()
562 p+= 2; in php_mysqlnd_auth_write()
567 len = MIN(strlen(packet->auth_plugin_name), sizeof(buffer) - (p - buffer) - 1); in php_mysqlnd_auth_write()
568 memcpy(p, packet->auth_plugin_name, len); in php_mysqlnd_auth_write()
569 p+= len; in php_mysqlnd_auth_write()
570 *p++= '\0'; in php_mysqlnd_auth_write()
591 …if (sizeof(buffer) >= (ca_payload_len + php_mysqlnd_net_store_length_size(ca_payload_len) + (p - b… in php_mysqlnd_auth_write()
592 p = php_mysqlnd_net_store_length(p, ca_payload_len); in php_mysqlnd_auth_write()
602 p = php_mysqlnd_net_store_length(p, ZSTR_LEN(key)); in php_mysqlnd_auth_write()
603 memcpy(p, ZSTR_VAL(key), ZSTR_LEN(key)); in php_mysqlnd_auth_write()
604 p+= ZSTR_LEN(key); in php_mysqlnd_auth_write()
606 p = php_mysqlnd_net_store_length(p, value_len); in php_mysqlnd_auth_write()
607 memcpy(p, Z_STRVAL_P(entry_value), value_len); in php_mysqlnd_auth_write()
608 p+= value_len; in php_mysqlnd_auth_write()
619 …const MYSQLND_CSTRING payload = {(char*) buffer + MYSQLND_HEADER_SIZE, p - (buffer + MYSQLND_HEADE… in php_mysqlnd_auth_write()
623 DBG_RETURN(ret == PASS? (p - buffer - MYSQLND_HEADER_SIZE) : 0); in php_mysqlnd_auth_write()
629 …const size_t sent = pfc->data->m.send(pfc, vio, buffer, p - buffer - MYSQLND_HEADER_SIZE, stats, e… in php_mysqlnd_auth_write()
654 const zend_uchar * p = buf; in php_mysqlnd_auth_response_read() local
673 packet->response_code = uint1korr(p); in php_mysqlnd_auth_response_read()
674 p++; in php_mysqlnd_auth_response_read()
678 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_auth_response_read()
686 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_auth_response_read()
687 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_auth_response_read()
689 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_auth_response_read()
691 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_auth_response_read()
694 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_auth_response_read()
702 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
705 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_auth_response_read()
708 packet->server_status = uint2korr(p); in php_mysqlnd_auth_response_read()
709 p+= 2; in php_mysqlnd_auth_response_read()
712 packet->warning_count = uint2korr(p); in php_mysqlnd_auth_response_read()
713 p+= 2; in php_mysqlnd_auth_response_read()
717 if (packet->header.size > (size_t) (p - buf) && (net_len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_auth_response_read()
718 packet->message_len = MIN(net_len, buf_len - (p - begin)); in php_mysqlnd_auth_response_read()
719 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_auth_response_read()
732 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
734 p - begin - packet->header.size); in php_mysqlnd_auth_response_read()
744 MYSQLND_PACKET_AUTH_RESPONSE * p = (MYSQLND_PACKET_AUTH_RESPONSE *) _packet; in php_mysqlnd_auth_response_free_mem() local
745 if (p->message) { in php_mysqlnd_auth_response_free_mem()
746 mnd_efree(p->message); in php_mysqlnd_auth_response_free_mem()
747 p->message = NULL; in php_mysqlnd_auth_response_free_mem()
749 if (p->new_auth_protocol) { in php_mysqlnd_auth_response_free_mem()
750 mnd_efree(p->new_auth_protocol); in php_mysqlnd_auth_response_free_mem()
751 p->new_auth_protocol = NULL; in php_mysqlnd_auth_response_free_mem()
753 p->new_auth_protocol_len = 0; in php_mysqlnd_auth_response_free_mem()
755 if (p->new_auth_protocol_data) { in php_mysqlnd_auth_response_free_mem()
756 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_auth_response_free_mem()
757 p->new_auth_protocol_data = NULL; in php_mysqlnd_auth_response_free_mem()
759 p->new_auth_protocol_data_len = 0; in php_mysqlnd_auth_response_free_mem()
776 zend_uchar * p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ in php_mysqlnd_change_auth_response_write() local
781 memcpy(p, packet->auth_data, packet->auth_data_len); in php_mysqlnd_change_auth_response_write()
782 p+= packet->auth_data_len; in php_mysqlnd_change_auth_response_write()
790 …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()
818 const zend_uchar * p = buf; in php_mysqlnd_ok_read() local
830 packet->field_count = uint1korr(p); in php_mysqlnd_ok_read()
831 p++; in php_mysqlnd_ok_read()
835 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_ok_read()
842 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
845 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_ok_read()
848 packet->server_status = uint2korr(p); in php_mysqlnd_ok_read()
849 p+= 2; in php_mysqlnd_ok_read()
852 packet->warning_count = uint2korr(p); in php_mysqlnd_ok_read()
853 p+= 2; in php_mysqlnd_ok_read()
857 if (packet->header.size > (size_t) (p - buf) && (net_len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_ok_read()
858 packet->message_len = MIN(net_len, buf_len - (p - begin)); in php_mysqlnd_ok_read()
859 packet->message = mnd_pestrndup((char *)p, packet->message_len, FALSE); in php_mysqlnd_ok_read()
873 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_ok_read()
875 p - begin - packet->header.size); in php_mysqlnd_ok_read()
885 MYSQLND_PACKET_OK *p= (MYSQLND_PACKET_OK *) _packet; in php_mysqlnd_ok_free_mem() local
886 if (p->message) { in php_mysqlnd_ok_free_mem()
887 mnd_efree(p->message); in php_mysqlnd_ok_free_mem()
888 p->message = NULL; in php_mysqlnd_ok_free_mem()
912 const zend_uchar * p = buf; in php_mysqlnd_eof_read() local
923 packet->field_count = uint1korr(p); in php_mysqlnd_eof_read()
924 p++; in php_mysqlnd_eof_read()
928 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_eof_read()
941 packet->warning_count = uint2korr(p); in php_mysqlnd_eof_read()
942 p+= 2; in php_mysqlnd_eof_read()
945 packet->server_status = uint2korr(p); in php_mysqlnd_eof_read()
946 p+= 2; in php_mysqlnd_eof_read()
960 DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_eof_read()
962 p - begin - packet->header.size); in php_mysqlnd_eof_read()
1005 zend_uchar *tmp, *p; in php_mysqlnd_cmd_write() local
1010 p = tmp + MYSQLND_HEADER_SIZE; /* skip the header */ in php_mysqlnd_cmd_write()
1012 int1store(p, packet->command); in php_mysqlnd_cmd_write()
1013 p++; in php_mysqlnd_cmd_write()
1015 memcpy(p, packet->argument.s, packet->argument.l); in php_mysqlnd_cmd_write()
1049 const zend_uchar * p = buf; in php_mysqlnd_rset_header_read() local
1064 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_header_read()
1066 p++; in php_mysqlnd_rset_header_read()
1068 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_header_read()
1075 packet->field_count = php_mysqlnd_net_field_length(&p); in php_mysqlnd_rset_header_read()
1091 memcpy(packet->info_or_local_file.s, p, len); in php_mysqlnd_rset_header_read()
1101 packet->affected_rows = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1104 packet->last_insert_id = php_mysqlnd_net_field_length_ll(&p); in php_mysqlnd_rset_header_read()
1107 packet->server_status = uint2korr(p); in php_mysqlnd_rset_header_read()
1108 p+=2; in php_mysqlnd_rset_header_read()
1111 packet->warning_count = uint2korr(p); in php_mysqlnd_rset_header_read()
1112 p+=2; in php_mysqlnd_rset_header_read()
1115 if (packet->header.size > (size_t) (p - buf) && (len = php_mysqlnd_net_field_length(&p))) { in php_mysqlnd_rset_header_read()
1118 memcpy(packet->info_or_local_file.s, p, len); in php_mysqlnd_rset_header_read()
1139 DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1141 p - begin - packet->header.size); in php_mysqlnd_rset_header_read()
1151 MYSQLND_PACKET_RSET_HEADER *p= (MYSQLND_PACKET_RSET_HEADER *) _packet; in php_mysqlnd_rset_header_free_mem() local
1153 if (p->info_or_local_file.s) { in php_mysqlnd_rset_header_free_mem()
1154 mnd_efree(p->info_or_local_file.s); in php_mysqlnd_rset_header_free_mem()
1155 p->info_or_local_file.s = NULL; in php_mysqlnd_rset_header_free_mem()
1162 len = php_mysqlnd_net_field_length(&p); \
1166 meta->field_name = (const char *)p; \
1168 p += len; \
1191 const zend_uchar * p = buf; in php_mysqlnd_rset_field_read() local
1208 if (ERROR_MARKER == *p) { in php_mysqlnd_rset_field_read()
1210 p++; in php_mysqlnd_rset_field_read()
1212 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_rset_field_read()
1218 } else if (EODATA_MARKER == *p && packet->header.size < 8) { in php_mysqlnd_rset_field_read()
1235 if (UNEXPECTED(12 != *p)) { in php_mysqlnd_rset_field_read()
1236 DBG_ERR_FMT("Protocol error. Server sent false length. Expected 12 got %d", (int) *p); in php_mysqlnd_rset_field_read()
1240 if ((size_t)((p - begin) + 12) > packet->header.size) { in php_mysqlnd_rset_field_read()
1245 p++; in php_mysqlnd_rset_field_read()
1247 meta->charsetnr = uint2korr(p); in php_mysqlnd_rset_field_read()
1248 p += 2; in php_mysqlnd_rset_field_read()
1250 meta->length = uint4korr(p); in php_mysqlnd_rset_field_read()
1251 p += 4; in php_mysqlnd_rset_field_read()
1253 meta->type = uint1korr(p); in php_mysqlnd_rset_field_read()
1254 p += 1; in php_mysqlnd_rset_field_read()
1256 meta->flags = uint2korr(p); in php_mysqlnd_rset_field_read()
1257 p += 2; in php_mysqlnd_rset_field_read()
1259 meta->decimals = uint1korr(p); in php_mysqlnd_rset_field_read()
1260 p += 1; in php_mysqlnd_rset_field_read()
1263 p +=2; in php_mysqlnd_rset_field_read()
1280 if (packet->header.size > (size_t) (p - buf) && in php_mysqlnd_rset_field_read()
1281 (len = php_mysqlnd_net_field_length(&p)) && in php_mysqlnd_rset_field_read()
1287 memcpy(meta->def, p, len); in php_mysqlnd_rset_field_read()
1290 p += len; in php_mysqlnd_rset_field_read()
1352 DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1354 "shorter than expected", p - begin - packet->header.size); in php_mysqlnd_rset_field_read()
1382 zend_uchar * p = NULL; in php_mysqlnd_read_row_ex() local
1409 p = buffer->ptr; in php_mysqlnd_read_row_ex()
1411 …if (UNEXPECTED(PASS != (ret = pfc->data->m.receive(pfc, vio, p, header.size, stats, error_info))))… in php_mysqlnd_read_row_ex()
1439 p = (zend_uchar *) buffer->ptr + (*data_size - header.size); in php_mysqlnd_read_row_ex()
1441 if (PASS != (ret = pfc->data->m.receive(pfc, vio, p, header.size, stats, error_info))) { in php_mysqlnd_read_row_ex()
1466 const zend_uchar * p = row_buffer->ptr; in php_mysqlnd_rowp_read_binary_protocol() local
1480 p++; in php_mysqlnd_rowp_read_binary_protocol()
1481 null_ptr= p; in php_mysqlnd_rowp_read_binary_protocol()
1482 p += (field_count + 9)/8; /* skip null bits */ in php_mysqlnd_rowp_read_binary_protocol()
1487 const zend_uchar * orig_p = p; in php_mysqlnd_rowp_read_binary_protocol()
1499 mysqlnd_ps_fetch_functions[type].func(current_field, &fields_metadata[i], 0, &p); in php_mysqlnd_rowp_read_binary_protocol()
1537 Z_STRLEN_P(current_field) : (size_t)(p - orig_p)); in php_mysqlnd_rowp_read_binary_protocol()
1558 zend_uchar * p = row_buffer->ptr; in php_mysqlnd_rowp_read_text_protocol_aux() local
1560 const zend_uchar * const packet_end = (zend_uchar*) p + data_size; in php_mysqlnd_rowp_read_text_protocol_aux()
1572 const zend_ulong len = php_mysqlnd_net_field_length((const zend_uchar **) &p); in php_mysqlnd_rowp_read_text_protocol_aux()
1577 } else if ((p + len) > packet_end) { in php_mysqlnd_rowp_read_text_protocol_aux()
1579 " bytes after end of packet", (p + len) - packet_end - 1); in php_mysqlnd_rowp_read_text_protocol_aux()
1626 …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()
1631 p -= len; in php_mysqlnd_rowp_read_text_protocol_aux()
1643 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol_aux()
1645 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol_aux()
1650 atoll((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1652 _atoi64((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1658 (uint64_t) atoll((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1660 (uint64_t) _atoi64((char *) p); in php_mysqlnd_rowp_read_text_protocol_aux()
1674 ZVAL_STRINGL(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol_aux()
1679 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol_aux()
1681 zend_uchar save = *(p + len); in php_mysqlnd_rowp_read_text_protocol_aux()
1683 *(p + len) = '\0'; in php_mysqlnd_rowp_read_text_protocol_aux()
1684 ZVAL_DOUBLE(current_field, zend_strtod((char *) p, NULL)); in php_mysqlnd_rowp_read_text_protocol_aux()
1685 *(p + len) = save; in php_mysqlnd_rowp_read_text_protocol_aux()
1691 ZVAL_INTERNED_STR(current_field, ZSTR_CHAR((zend_uchar)*(char *)p)); in php_mysqlnd_rowp_read_text_protocol_aux()
1693 ZVAL_STRINGL(current_field, (char *)p, len); in php_mysqlnd_rowp_read_text_protocol_aux()
1695 p += len; in php_mysqlnd_rowp_read_text_protocol_aux()
1745 zend_uchar *p; in php_mysqlnd_rowp_read() local
1773 if (ERROR_MARKER == (*(p = packet->row_buffer.ptr))) { in php_mysqlnd_rowp_read()
1780 php_mysqlnd_read_error_from_line(p + 1, data_size - 1, in php_mysqlnd_rowp_read()
1786 } else if (EODATA_MARKER == *p && data_size < 8) { /* EOF */ in php_mysqlnd_rowp_read()
1788 p++; in php_mysqlnd_rowp_read()
1790 packet->warning_count = uint2korr(p); in php_mysqlnd_rowp_read()
1791 p += 2; in php_mysqlnd_rowp_read()
1792 packet->server_status = uint2korr(p); in php_mysqlnd_rowp_read()
1836 MYSQLND_PACKET_ROW *p; in php_mysqlnd_rowp_free_mem() local
1839 p = (MYSQLND_PACKET_ROW *) _packet; in php_mysqlnd_rowp_free_mem()
1840 if (p->row_buffer.ptr) { in php_mysqlnd_rowp_free_mem()
1841 p->result_set_memory_pool->free_chunk(p->result_set_memory_pool, p->row_buffer.ptr); in php_mysqlnd_rowp_free_mem()
1842 p->row_buffer.ptr = NULL; in php_mysqlnd_rowp_free_mem()
1889 MYSQLND_PACKET_STATS *p= (MYSQLND_PACKET_STATS *) _packet; in php_mysqlnd_stats_free_mem() local
1890 if (p->message.s) { in php_mysqlnd_stats_free_mem()
1891 mnd_efree(p->message.s); in php_mysqlnd_stats_free_mem()
1892 p->message.s = NULL; in php_mysqlnd_stats_free_mem()
1915 zend_uchar *p = buf; in php_mysqlnd_prepare_read() local
1927 packet->error_code = uint1korr(p); in php_mysqlnd_prepare_read()
1928 p++; in php_mysqlnd_prepare_read()
1932 php_mysqlnd_read_error_from_line(p, data_size - 1, in php_mysqlnd_prepare_read()
1949 packet->stmt_id = uint4korr(p); in php_mysqlnd_prepare_read()
1950 p += 4; in php_mysqlnd_prepare_read()
1954 packet->field_count = uint2korr(p); in php_mysqlnd_prepare_read()
1955 p += 2; in php_mysqlnd_prepare_read()
1958 packet->param_count = uint2korr(p); in php_mysqlnd_prepare_read()
1959 p += 2; in php_mysqlnd_prepare_read()
1964 p++; in php_mysqlnd_prepare_read()
1967 packet->warning_count = uint2korr(p); in php_mysqlnd_prepare_read()
1977 DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_prepare_read()
1979 p - begin - packet->header.size); in php_mysqlnd_prepare_read()
1998 zend_uchar *p = buf; in php_mysqlnd_chg_user_read() local
2014 packet->response_code = uint1korr(p); in php_mysqlnd_chg_user_read()
2015 p++; in php_mysqlnd_chg_user_read()
2024 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_chg_user_read()
2032 if (packet->response_code == 0xFE && packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_chg_user_read()
2033 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_chg_user_read()
2035 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_chg_user_read()
2036 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_chg_user_read()
2039 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_chg_user_read()
2047 DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
2049 p - begin - packet->header.size); in php_mysqlnd_chg_user_read()
2059 MYSQLND_PACKET_CHG_USER_RESPONSE * p = (MYSQLND_PACKET_CHG_USER_RESPONSE *) _packet; in php_mysqlnd_chg_user_free_mem() local
2061 if (p->new_auth_protocol) { in php_mysqlnd_chg_user_free_mem()
2062 mnd_efree(p->new_auth_protocol); in php_mysqlnd_chg_user_free_mem()
2063 p->new_auth_protocol = NULL; in php_mysqlnd_chg_user_free_mem()
2065 p->new_auth_protocol_len = 0; in php_mysqlnd_chg_user_free_mem()
2067 if (p->new_auth_protocol_data) { in php_mysqlnd_chg_user_free_mem()
2068 mnd_efree(p->new_auth_protocol_data); in php_mysqlnd_chg_user_free_mem()
2069 p->new_auth_protocol_data = NULL; in php_mysqlnd_chg_user_free_mem()
2071 p->new_auth_protocol_data_len = 0; in php_mysqlnd_chg_user_free_mem()
2110 zend_uchar *p = buf; in php_mysqlnd_sha256_pk_request_response_read() local
2121 p++; in php_mysqlnd_sha256_pk_request_response_read()
2124 packet->public_key_len = packet->header.size - (p - buf); in php_mysqlnd_sha256_pk_request_response_read()
2126 memcpy(packet->public_key, p, packet->public_key_len); in php_mysqlnd_sha256_pk_request_response_read()
2132 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2134 p - begin - packet->header.size); in php_mysqlnd_sha256_pk_request_response_read()
2144 …MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE * p = (MYSQLND_PACKET_SHA256_PK_REQUEST_RESPONSE *) _pac… in php_mysqlnd_sha256_pk_request_response_free_mem() local
2145 if (p->public_key) { in php_mysqlnd_sha256_pk_request_response_free_mem()
2146 mnd_efree(p->public_key); in php_mysqlnd_sha256_pk_request_response_free_mem()
2147 p->public_key = NULL; in php_mysqlnd_sha256_pk_request_response_free_mem()
2149 p->public_key_len = 0; in php_mysqlnd_sha256_pk_request_response_free_mem()
2189 zend_uchar *p = buf; in php_mysqlnd_cached_sha2_result_read() local
2198 packet->response_code = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2199 p++; in php_mysqlnd_cached_sha2_result_read()
2203 php_mysqlnd_read_error_from_line(p, packet->header.size - 1, in php_mysqlnd_cached_sha2_result_read()
2211 if (packet->header.size > (size_t) (p - buf)) { in php_mysqlnd_cached_sha2_result_read()
2212 packet->new_auth_protocol = mnd_pestrdup((char *)p, FALSE); in php_mysqlnd_cached_sha2_result_read()
2214 p+= packet->new_auth_protocol_len + 1; /* +1 for the \0 */ in php_mysqlnd_cached_sha2_result_read()
2216 packet->new_auth_protocol_data_len = packet->header.size - (size_t) (p - buf); in php_mysqlnd_cached_sha2_result_read()
2219 memcpy(packet->new_auth_protocol_data, p, packet->new_auth_protocol_data_len); in php_mysqlnd_cached_sha2_result_read()
2232 packet->response_code = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2233 p++; in php_mysqlnd_cached_sha2_result_read()
2236 packet->result = uint1korr(p); in php_mysqlnd_cached_sha2_result_read()
2242 DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size); in php_mysqlnd_cached_sha2_result_read()
2244 p - begin - packet->header.size); in php_mysqlnd_cached_sha2_result_read()