Commit Graph

67 Commits

Author SHA1 Message Date
Harvey Tuch 5f3cfe960f Fix read from uninitialized memory bug in GrpcBufferWriter.
This commit fixes an issue in which the following sequence of operations
leads to use of uninitialized memory:

1. Caller invokes GrpcBufferWriter::Next(), and then makes use of 8191
   bytes in the returned buffer (which is 8192 bytes in size).

2. Caller then returns the unused single byte via
   GrpcBufferWriter::BackUp(). This method invokes
   g_core_codegen_interface->grpc_slice_split_tail(), which causes
   backup_slice_ to be a grpc_slice with one byte.

3. At the next invocation of GrpcBufferWriter::Next(), a reference to
   the single byte grpc_slice is returned to the caller.

The problem here is that the returned reference is to the inlined buffer
in the grpc_slice, which is resident in slice_, not the location of the
buffer inside slice_buffer_ after
g_core_codegen_interface->grpc_slice_buffer_add() in
GrpcBufferWriter::Next(). As a result, any data the caller writes to the
returned void* data is lost.

The solution is to avoid inlined backup slices.
2017-02-07 15:45:44 -05:00
Ronak Jain a3f8097b34 replaced protobuf tag in compile_test_golden 2016-12-14 22:52:38 +05:30
Vijay Pai c0b2acb1a0 Use C++11 final and override 2016-11-01 16:31:56 -07:00
Vijay Pai 08126092e6 golden file 2016-10-13 14:17:41 -07:00
David Garcia Quintas d10f1775eb Merge branch 'master' of github.com:grpc/grpc into codegen_cleanse 2016-09-03 12:42:02 +02:00
Vijay Pai 3703ece81b a golden file 2016-08-30 12:13:39 -07:00
Vijay Pai d05cad245a Fix golden test 2016-08-30 10:22:06 -07:00
Vijay Pai 48c9ca2bf1 Update golden file 2016-08-29 17:10:18 -07:00
Vijay Pai 6d214bcff7 Add FCService to golden test 2016-08-04 12:03:12 -07:00
David Garcia Quintas 1399e466b0 removed codegen/time.h 2016-07-27 20:31:55 -07:00
vjpai 9959f3d0ec Fix the golden file - why do we even have this lever? 2016-06-23 23:19:15 -07:00
yang-g 2e08941a37 Use the comments before syntax line as file comments. 2016-04-15 10:46:41 -07:00
yang-g 8282b755a2 Clarify the comments 2016-04-14 17:13:24 -07:00
yang-g b8aa58b2cd Add a test 2016-04-14 15:53:45 -07:00
David Garcia Quintas 3a43cc06a8 Added codegen_test_full
Which makes sure target that depend on both codegen and grpc build.
2016-04-08 16:59:51 -07:00
David Garcia Quintas b942640497 clang-format 2016-03-08 16:25:11 -08:00
David Garcia Quintas 4ac52fa6dd WIP. Added codegen_test 2016-03-06 20:31:39 -08:00