Commit 5a9d6856 authored by holyfoot/hf@mysql.com/hfmain.(none)'s avatar holyfoot/hf@mysql.com/hfmain.(none)
Browse files

Bug #29117 (init_file test crashes with embedded server)

we use net->vio in my_net_local_init, but in the my_net_init
implementation we set it after the call, so work with unspecified
net->vio value
parent 52200be6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -111,13 +111,13 @@ static my_bool net_write_buff(NET *net,const char *packet,ulong len);
my_bool my_net_init(NET *net, Vio* vio)
{
  DBUG_ENTER("my_net_init");
  net->vio = vio;
  my_net_local_init(net);			/* Set some limits */
  if (!(net->buff=(uchar*) my_malloc((uint32) net->max_packet+
				     NET_HEADER_SIZE + COMP_HEADER_SIZE,
				     MYF(MY_WME))))
    DBUG_RETURN(1);
  net->buff_end=net->buff+net->max_packet;
  net->vio = vio;
  net->no_send_ok = 0;
  net->error=0; net->return_errno=0; net->return_status=0;
  net->pkt_nr=net->compress_pkt_nr=0;