stock_name is char[8] but you write at it 9 bytes.