[Pidgin] #16327: protobuf-c UB fixes (Gadu protocol)

Pidgin trac at pidgin.im
Wed Aug 27 02:18:04 EDT 2014


#16327: protobuf-c UB fixes (Gadu protocol)
--------------------------------------------+---------------------------
 Reporter:  JIghtuse                        |       Owner:  EionRobb
     Type:  patch                           |      Status:  new
Milestone:                                  |   Component:  unclassified
  Version:  3.0.0hg                         |  Resolution:
 Keywords:  UB, Gadu, protobuf, protobuf-c  |
--------------------------------------------+---------------------------
Description changed by JIghtuse:

Old description:

> I run scan-build from the Clang/LLVM project to check Pidgin on build. It
> found 11 problems. Some of them not really a bugs, some are. Full report
> attached as archive scan-build-2014-08-27-1.zip.
>
> This patch fixes two bugs in protobuf-c, included in Gadu protocol. Both
> of them is undefined behaviour in memcpy(). If we pass NULL pointer as
> source, result of such operation is undefined. GCC-4.9 can break some
> code in such cases  (see [https://gcc.gnu.org/gcc-4.9/porting_to.html
> Null pointer checks may be optimized away more aggressively]). Similar
> changes already included in the
> [https://github.com/protobuf-c/protobuf-c/blob/master/protobuf-c/protobuf-c.c
> latest protobuf-c version].

New description:

 I run scan-build from the Clang/LLVM project to check Pidgin on build. It
 found 11 problems. Some of them not really a bugs, some are. Full report
 attached as archive scan-build-2014-08-27-1.zip.

 This patch fixes two bugs in protobuf-c, included in Gadu protocol. Both
 of them is undefined behaviour in memcpy(). If we pass NULL pointer as
 destination, result of such operation is undefined. GCC-4.9 can break some
 code in such cases  (see [https://gcc.gnu.org/gcc-4.9/porting_to.html Null
 pointer checks may be optimized away more aggressively]). Similar changes
 already included in the
 [https://github.com/protobuf-c/protobuf-c/blob/master/protobuf-c/protobuf-c.c
 latest protobuf-c version].

--

--
Ticket URL: <https://developer.pidgin.im/ticket/16327#comment:2>
Pidgin <https://pidgin.im>
Pidgin


More information about the Tracker mailing list