aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-10-02Fix undefined behavior with bool fields (#434)Petteri Aimonen
Previously nanopb didn't enforce that decoded bool fields had valid true/false values. This could lead to undefined behavior in user code. This has potential security implications when 1) message contains bool field (has_ fields are safe) and 2) user code uses ternary operator dependent on the field value, such as: int value = msg.my_bool ? 1234 : 0 and 3) the value returned from ternary operator affects a memory access, such as: data_array[value] = 9999
2019-10-02Make fuzztest detect invalid bool values (#434)Petteri Aimonen
2019-08-27.gitignore: don't ignore generator-bin files (#419)Petteri Aimonen
2019-08-27Don't call stream callback with count=0 (#421)Petteri Aimonen
This could happen with zero-length submessages and strings. While technically valid, it is an useless call and a rare corner case that can easily lead to bugs in the callback implementation.
2019-08-27network_server example: Detect count=0 in read_callback() (#421)Petteri Aimonen
Previously the example code would falsely detect EOF condition if called with count = 0.
2019-08-27Add scons package to travis rules, for build automationPetteri Aimonen
2019-08-27Introduce new compile time flag: PB_ENCODE_ARRAYS_UNPACKEDPavol Rusnak
Don't encode scalar arrays as packed. This is only to be used when the decoder on the receiving side cannot process packed scalar arrays. Such example is older protobuf.js.
2019-06-01Add migration note about enum min/maxPetteri Aimonen
2019-06-01🔀 use min/max enum value for min/maxNoah Pendleton
Unsorted enums in message specifications do not result in correct min/max values per the protobuf spec for cpp code: https://developers.google.com/protocol-buffers/docs/reference/cpp-generated#enum The google cpp compiler uses the min/max _value_ instead of the position of the enum entry in the message spec, so this patch updates nanopb to do the same. Example input: ```protobuf syntax = "proto3"; enum Language { UNKNOWN = 0; ENGLISH_EN_GB = 12; ENGLISH_EN_US = 1; FRENCH_FR_FR = 2; ITALIAN_IT_IT = 3; GERMAN_DE_DE = 4; SPANISH_ES_AR = 13; SPANISH_ES_ES = 5; SPANISH_ES_MX = 14; SWEDISH_SV_SE = 6; DUTCH_NL_NL = 7; KOREAN_KO_KR = 8; JAPANESE_JA_JP = 9; CHINESE_SIMPLIFIED_ZH_CN = 10; CHINESE_TRADITIONAL_ZH_TW = 11; } ``` This would previously result in: ```c #define _Language_MIN Language_UNKNOWN #define _Language_MAX Language_CHINESE_TRADITIONAL_ZH_TW #define _Language_ARRAYSIZE ((Language)(Language_CHINESE_TRADITIONAL_ZH_TW+1)) ``` After this patch, ```c #define _Language_MIN Language_UNKNOWN #define _Language_MAX Language_SPANISH_ES_MX #define _Language_ARRAYSIZE ((Language)(Language_SPANISH_ES_MX+1)) ``` Add a test `enum_minmax` to cover this case.
2019-04-05Add host support for nanopb am: d8d508fb38 am: b97cbd30e1r_aml_301500702android-mainline-12.0.0_r55android-mainline-11.0.0_r9android-mainline-11.0.0_r8android-mainline-11.0.0_r7android-mainline-11.0.0_r6android-mainline-11.0.0_r5android-mainline-11.0.0_r45android-mainline-11.0.0_r44android-mainline-11.0.0_r43android-mainline-11.0.0_r42android-mainline-11.0.0_r41android-mainline-11.0.0_r40android-mainline-11.0.0_r4android-mainline-11.0.0_r39android-mainline-11.0.0_r38android-mainline-11.0.0_r37android-mainline-11.0.0_r36android-mainline-11.0.0_r35android-mainline-11.0.0_r34android-mainline-11.0.0_r33android-mainline-11.0.0_r32android-mainline-11.0.0_r31android-mainline-11.0.0_r30android-mainline-11.0.0_r3android-mainline-11.0.0_r29android-mainline-11.0.0_r28android-mainline-11.0.0_r27android-mainline-11.0.0_r26android-mainline-11.0.0_r25android-mainline-11.0.0_r24android-mainline-11.0.0_r23android-mainline-11.0.0_r22android-mainline-11.0.0_r21android-mainline-11.0.0_r20android-mainline-11.0.0_r2android-mainline-11.0.0_r19android-mainline-11.0.0_r18android-mainline-11.0.0_r17android-mainline-11.0.0_r16android-mainline-11.0.0_r15android-mainline-11.0.0_r14android-mainline-11.0.0_r13android-mainline-11.0.0_r12android-mainline-11.0.0_r10android-mainline-11.0.0_r1android-11.0.0_r9android-11.0.0_r8android-11.0.0_r7android-11.0.0_r48android-11.0.0_r47android-11.0.0_r46android-11.0.0_r45android-11.0.0_r44android-11.0.0_r43android-11.0.0_r42android-11.0.0_r41android-11.0.0_r40android-11.0.0_r39android-11.0.0_r38android-11.0.0_r37android-11.0.0_r36android-11.0.0_r35android-11.0.0_r34android-11.0.0_r33android-11.0.0_r32android-11.0.0_r31android-11.0.0_r30android-11.0.0_r29android-11.0.0_r28android-11.0.0_r27android-11.0.0_r26android-11.0.0_r24android-11.0.0_r23android-11.0.0_r22android-11.0.0_r21android-11.0.0_r20android-11.0.0_r19android-11.0.0_r18android-11.0.0_r16android-11.0.0_r15android-11.0.0_r14android-11.0.0_r13android-11.0.0_r12android-11.0.0_r11android-11.0.0_r10android11-qpr3-s1-releaseandroid11-qpr3-releaseandroid11-qpr2-releaseandroid11-qpr1-s2-releaseandroid11-qpr1-s1-releaseandroid11-qpr1-releaseandroid11-qpr1-d-s1-releaseandroid11-qpr1-d-releaseandroid11-qpr1-c-releaseandroid11-mainline-tethering-releaseandroid11-mainline-sparse-2021-jan-releaseandroid11-mainline-sparse-2020-dec-releaseandroid11-mainline-releaseandroid11-mainline-permission-releaseandroid11-mainline-os-statsd-releaseandroid11-mainline-networkstack-releaseandroid11-mainline-media-swcodec-releaseandroid11-mainline-media-releaseandroid11-mainline-extservices-releaseandroid11-mainline-documentsui-releaseandroid11-mainline-conscrypt-releaseandroid11-mainline-cellbroadcast-releaseandroid11-mainline-captiveportallogin-releaseandroid11-devandroid11-d2-releaseandroid11-d1-s7-releaseandroid11-d1-s6-releaseandroid11-d1-s5-releaseandroid11-d1-s1-releaseandroid11-d1-releaseandroid11-d1-b-releaseHansong Zhang
am: 07c127e075 Change-Id: I248ee8847450b3145c0ac9b06237d89f61a90a2d
2019-04-05Add host support for nanopb am: d8d508fb38bender-v1-stableandroid-r-preview-4android-r-preview-3android-r-preview-2android-r-preview-1android-mainline-10.0.0_r8android-mainline-10.0.0_r6ndk-sysroot-r21android10-mainline-resolv-releaseandroid10-mainline-networking-releaseandroid-games-sdk-unity-releaseandroid-games-sdk-unity-devHansong Zhang
am: b97cbd30e1 Change-Id: I0404d46f7f784ecd131080a4c1e755ccadc285e7
2019-04-05Add host support for nanopbandroid-o-mr1-iot-release-1.0.14android-o-mr1-iot-release-1.0.13Hansong Zhang
am: d8d508fb38 Change-Id: Ic059ea63104522e35704990577930b11dc16e02f
2019-04-03Add host support for nanopbandroid-q-preview-6android-q-preview-5android-q-preview-4android-q-preview-2.5android-o-mr1-iot-release-1.0.12oreo-mr1-iot-releaseHansong Zhang
Test: compile Change-Id: I9d5cb0b1d63cd38717f4a8e15785058da84262a4
2019-03-08Publishing nanopb-0.3.9.3Petteri Aimonen
2019-03-07Fix generator error with mangle_names option (#380)Petteri Aimonen
2019-03-07Add testcase for #380Petteri Aimonen
2019-03-07Fix incorrect PB_STATIC_ASSERT for bytes inside oneof (#363)Petteri Aimonen
2019-03-07Add testcase for #363Petteri Aimonen
2019-03-07Generator: Allow comma separated options in plugin mode (#343)Petteri Aimonen
2019-02-20Add 32BIT and 16BIT nanopb library. am: 3f5b6d4262 am: aaae7fff6eandroid-mainline-10.0.0_r9android-mainline-10.0.0_r7android-mainline-10.0.0_r5android-mainline-10.0.0_r4android-mainline-10.0.0_r10android-10.0.0_r9android-10.0.0_r8android-10.0.0_r7android-10.0.0_r45android-10.0.0_r44android-10.0.0_r43android-10.0.0_r42android-10.0.0_r41android-10.0.0_r40android-10.0.0_r39android-10.0.0_r38android-10.0.0_r37android-10.0.0_r36android-10.0.0_r35android-10.0.0_r34android-10.0.0_r33android-10.0.0_r32android-10.0.0_r31android-10.0.0_r30android-10.0.0_r29android-10.0.0_r28android-10.0.0_r27android-10.0.0_r26android-10.0.0_r25android-10.0.0_r24android-10.0.0_r23android-10.0.0_r22android-10.0.0_r21android-10.0.0_r20android-10.0.0_r19android-10.0.0_r18android-10.0.0_r16android-10.0.0_r15android-10.0.0_r14android-10.0.0_r13android-10.0.0_r12android10-qpr3-s1-releaseandroid10-qpr3-releaseandroid10-qpr2-s4-releaseandroid10-qpr2-s3-releaseandroid10-qpr2-s2-releaseandroid10-qpr2-s1-releaseandroid10-qpr2-releaseandroid10-qpr1-releaseandroid10-qpr1-mainline-releaseandroid10-qpr1-d-releaseandroid10-qpr1-c-s1-releaseandroid10-qpr1-c-releaseandroid10-qpr1-b-s1-releaseandroid10-qpr1-b-releaseandroid10-mainline-media-releaseandroid10-devandroid10-d4-s1-releaseandroid10-d4-releaseandroid10-c2f2-s2-releaseandroid10-c2f2-s1-releaseandroid10-c2f2-releaseYu Shan
am: 1d0ca59852 Change-Id: I412488a20b4fcfa05f58528c2e38fff5a7e3a0c0
2019-02-20Add 32BIT and 16BIT nanopb library. am: 3f5b6d4262Yu Shan
am: aaae7fff6e Change-Id: I7e9b49665176548ce0c7d5e5c9f3c62ec37d5650
2019-02-20Add 32BIT and 16BIT nanopb library.Yu Shan
am: 3f5b6d4262 Change-Id: I2f79eba12ecf6e8d7ab7ed2d102bbe745c0b6c0c
2019-02-19Add 32BIT and 16BIT nanopb library.android-q-preview-1android-o-mr1-iot-release-1.0.10Yu Shan
Add 32BIT and 16BIT compile time flag for nanopb library to support 16BIT or 32BIT size, default is 8BIT. User need to use the corresponding library when define the PB_FIELD_* flag during compilation. Test: None Bug: 122292884 Change-Id: I1b3c572e54297d020776e7721d37b65526f1a0ff
2019-02-04Merge Android Games SDK into master. am: 4090366181 am: eeedc9b64bXin Li
am: e80a74a431 Change-Id: I120cf2f5451910c68e9ebfad9d86358c02b32098
2019-02-04Merge Android Games SDK into master. am: 4090366181Xin Li
am: eeedc9b64b Change-Id: I3355d9aa570683a1488f528752342ce4527c6190
2019-02-04Merge Android Games SDK into master.Xin Li
am: 4090366181 Change-Id: Ic5a149eb6e898140647c92aa446f5614cfbcb7d0
2019-02-04Merge Android Games SDK into master.Xin Li
Bug: 123068679 Change-Id: I7b75d9d7c8a8980bcceafc44580fb70ce4d31938
2019-01-30Fix encoding of fixed size arrays inside proto3 submessages (#376)Petteri Aimonen
2019-01-30Add regression test for issue #376Petteri Aimonen
2019-01-11Add default code reviewers into OWNERS am: b5cea29f5e am: 7ef083d766Chih-Hung Hsieh
am: be7f0300db Change-Id: Icb79d01247504977e99800b9d0ad8635d2d292d8
2019-01-11Add default code reviewers into OWNERS am: b5cea29f5eChih-Hung Hsieh
am: 7ef083d766 Change-Id: Ice842086225ed70303eb9432489888ff20a23412
2019-01-11Add default code reviewers into OWNERSChih-Hung Hsieh
am: b5cea29f5e Change-Id: I7ebbe28c941c8e8c91f147bc7a0981d98c946a56
2019-01-11Add default code reviewers into OWNERSChih-Hung Hsieh
Bug: 33166666 Test: gerrit uploader Change-Id: I0d65423c625fd4085a88fe0fdbeaa27cb7909c43
2018-11-10Merge 'master' into maintenance_0.3Petteri Aimonen
A bit of a mess, should have done the 0.3.9.2 release from this branch instead. Oh well, doesn't change anything.
2018-11-10Publishing nanopb-0.3.9.2Petteri Aimonen
2018-11-04Update changelog & authorsPetteri Aimonen
2018-11-02Fix splint test error (#359)Petteri Aimonen
2018-11-01Merge pull request #358 from uraj/oneof-docsPetteri Aimonen
Clarify the usage of callback fields inside oneof sections in the docs
2018-11-01Clarify the usage of callback fields inside oneof sections in the docsPei Wang
2018-10-24[automerger skipped] Merge pie-platform-release to aosp-master - DO NOT ↵Bill Yi
MERGE am: c8cd40fafa -s ours am: 1457d4dfb9 -s ours am: 90df857c8f -s ours Change-Id: Iad213fa375bd4b5733d73cdabfe63aac1aade16d
2018-10-24[automerger skipped] Merge pie-platform-release to aosp-master - DO NOT ↵Bill Yi
MERGE am: c8cd40fafa -s ours am: 1457d4dfb9 -s ours Change-Id: I9a3c40d09131859174d46e53a127a89e9eb9917d
2018-10-24[automerger skipped] Merge pie-platform-release to aosp-master - DO NOT MERGEBill Yi
am: c8cd40fafa -s ours Change-Id: I47ea8b0732f1eda7547e58081b1fd0454c86e378
2018-10-24Merge pie-platform-release to aosp-master - DO NOT MERGEandroid-wear-8.0.0_r2android-o-mr1-iot-release-smart-display-r9android-o-mr1-iot-release-smart-display-r8android-o-mr1-iot-release-smart-display-r5android-o-mr1-iot-release-smart-display-r40.1Jandroid-o-mr1-iot-release-smart-display-r4android-o-mr1-iot-release-smart-display-r39android-o-mr1-iot-release-smart-display-r30android-o-mr1-iot-release-smart-display-r22android-o-mr1-iot-release-smart-display-r14android-o-mr1-iot-release-smart-clock-r6android-o-mr1-iot-release-smart-clock-r2android-o-mr1-iot-release-smart-clock-fsiandroid-o-mr1-iot-release-smart-clock-fcsandroid-o-mr1-iot-release-cube_r2android-o-mr1-iot-release-cube-fsiandroid-o-mr1-iot-release-cube-fcsandroid-o-mr1-iot-release-1.0.8android-o-mr1-iot-release-1.0.7android-n-iot-release-ihome-igv1nougat-iot-releaseBill Yi
Change-Id: Iaa0bee4c8ee4dace87ef0ad2aee6d8537ffd101c
2018-10-24[automerger skipped] Merge pi-platform-release to stage-aosp-master - DO NOT ↵Bill Yi
MERGE am: ba5d139354 -s ours am: 3ce1eb5d7a -s ours Change-Id: I5c812a72d24c30207f2d8f4f1c04c7ddac200104
2018-10-24[automerger skipped] Merge pi-platform-release to stage-aosp-master - DO NOT ↵Bill Yi
MERGE am: ba5d139354 -s ours Change-Id: I84269a992148b8c4beec3aee31073eb7e62dc974
2018-10-24Merge pull request #353 from mrostecki/cmakedir-libdirPetteri Aimonen
cmake: Include CMAKE_INSTALL_LIBDIR in CMAKE_INSTALL_CMAKEDIR
2018-10-24Merge pull request #352 from mrostecki/sharedPetteri Aimonen
cmake: Allow to build a shared library
2018-10-24Merge pi-platform-release to stage-aosp-master - DO NOT MERGEBill Yi
Change-Id: Id358b7b183cdb993644b08f1587085f1fc672bc7
2018-10-24cmake: Include CMAKE_INSTALL_LIBDIR in CMAKE_INSTALL_CMAKEDIRMichal Rostecki
If user defines non-standard directory in CMAKE_INSTALL_LIBDIR option (i.e. /usr/lib64), then CMAKE_INSTALL_CMAKEDIR should use it as a prefix.
2018-10-24cmake: Allow to build a shared libraryMichal Rostecki
Introduce options BUILD_SHARED_LIBS and BUILD_STATIC_LIBS to allow building both types of libraries. By default only BUILD_STATIC_LIBS is enabled.