shiyilei / protobuf-c

Automatically exported from code.google.com/p/protobuf-c
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Bug in protobuf_c_dispatch_new #65

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

In protobuf_c_dispatch_new() rv->base.changes is allocated as

  rv->changes_alloced = 8;
  rv->base.changes = ALLOC (sizeof (ProtobufC_FDNotify) * rv->changes_alloced);

But its type is ProtobufC_FDNotifyChange:

struct _ProtobufCDispatch
{
  /* changes to the events you are interested in. */
  /* (this handles closed file-descriptors 
     in a manner agreeable to epoll(2) and kqueue(2)) */
  size_t n_changes;
  ProtobufC_FDNotifyChange *changes;
  ...
}

What is the expected output? What do you see instead?

Expected allocation is 

rv->base.changes = ALLOC (sizeof (ProtobufC_FDNotifyChange) * 
rv->changes_alloced);

What version of the product are you using? On what operating system?
protobuf-c-0.14, Ubuntu natty

Original issue reported on code.google.com by l...@zadarastorage.com on 22 Jun 2011 at 7:12

GoogleCodeExporter commented 8 years ago
fixed in subversion

Original comment by lahike...@gmail.com on 2 Nov 2011 at 2:26