Check metadata size in payload.

Detect overflow for unsigned integer addition.

Bug: 113118184
Test: manual test with a hand crafted payload
Change-Id: I0155de49c241c392fb74f3d830ceebdb4174f872
(cherry picked from commit 08769f9c05199f96b257eded926975fd83c6edbf)
(cherry picked from commit 3e9410898d2687d7df3bdb03c6830d3ec428c2c6)
2 files changed
tree: 2e832fa33f6249e11659f1eeae0255fe37fc8b56
  1. binder_bindings/
  2. client_library/
  3. common/
  4. dbus_bindings/
  5. init/
  6. payload_consumer/
  7. payload_generator/
  8. sample_images/
  9. scripts/
  10. update_manager/
  11. update_payload_key/
  12. .gitignore
  13. Android.bp
  14. Android.mk
  15. COMMIT-QUEUE.ini
  16. CPPLINT.cfg
  17. MODULE_LICENSE_APACHE2
  18. NOTICE
  19. OWNERS
  20. PRESUBMIT.cfg
  21. PREUPLOAD.cfg
  22. UpdateEngine.conf
  23. WATCHLISTS
  24. binder_service_android.cc
  25. binder_service_android.h
  26. binder_service_brillo.cc
  27. binder_service_brillo.h
  28. boot_control_android.cc
  29. boot_control_android.h
  30. boot_control_chromeos.cc
  31. boot_control_chromeos.h
  32. boot_control_chromeos_unittest.cc
  33. boot_control_recovery.cc
  34. boot_control_recovery.h
  35. boot_control_recovery_stub.cc
  36. certificate_checker.cc
  37. certificate_checker.h
  38. certificate_checker_unittest.cc
  39. chrome_browser_proxy_resolver.cc
  40. chrome_browser_proxy_resolver.h
  41. common_service.cc
  42. common_service.h
  43. common_service_unittest.cc
  44. connection_manager.cc
  45. connection_manager.h
  46. connection_manager_android.cc
  47. connection_manager_android.h
  48. connection_manager_interface.h
  49. connection_manager_unittest.cc
  50. connection_utils.cc
  51. connection_utils.h
  52. daemon.cc
  53. daemon.h
  54. daemon_state_android.cc
  55. daemon_state_android.h
  56. daemon_state_interface.h
  57. dbus_connection.cc
  58. dbus_connection.h
  59. dbus_service.cc
  60. dbus_service.h
  61. dbus_test_utils.h
  62. fake_file_writer.h
  63. fake_p2p_manager.h
  64. fake_p2p_manager_configuration.h
  65. fake_shill_proxy.cc
  66. fake_shill_proxy.h
  67. fake_system_state.cc
  68. fake_system_state.h
  69. generate_pc_file.sh
  70. hardware_android.cc
  71. hardware_android.h
  72. hardware_chromeos.cc
  73. hardware_chromeos.h
  74. hardware_chromeos_unittest.cc
  75. image_properties.h
  76. image_properties_android.cc
  77. image_properties_android_unittest.cc
  78. image_properties_chromeos.cc
  79. image_properties_chromeos_unittest.cc
  80. libcurl_http_fetcher.cc
  81. libcurl_http_fetcher.h
  82. libupdate_engine-client-test.pc.in
  83. libupdate_engine-client.pc.in
  84. local_coverage_rate
  85. main.cc
  86. metrics_constants.h
  87. metrics_reporter_android.cc
  88. metrics_reporter_android.h
  89. metrics_reporter_interface.h
  90. metrics_reporter_omaha.cc
  91. metrics_reporter_omaha.h
  92. metrics_reporter_omaha_unittest.cc
  93. metrics_reporter_stub.cc
  94. metrics_reporter_stub.h
  95. metrics_utils.cc
  96. metrics_utils.h
  97. metrics_utils_unittest.cc
  98. mock_certificate_checker.h
  99. mock_connection_manager.h
  100. mock_file_writer.h
  101. mock_metrics_reporter.h
  102. mock_omaha_request_params.h
  103. mock_p2p_manager.h
  104. mock_payload_state.h
  105. mock_power_manager.h
  106. mock_proxy_resolver.h
  107. mock_service_observer.h
  108. mock_update_attempter.h
  109. network_selector.h
  110. network_selector_android.cc
  111. network_selector_android.h
  112. network_selector_interface.h
  113. network_selector_stub.cc
  114. network_selector_stub.h
  115. omaha_request_action.cc
  116. omaha_request_action.h
  117. omaha_request_action_unittest.cc
  118. omaha_request_params.cc
  119. omaha_request_params.h
  120. omaha_request_params_unittest.cc
  121. omaha_response.h
  122. omaha_response_handler_action.cc
  123. omaha_response_handler_action.h
  124. omaha_response_handler_action_unittest.cc
  125. omaha_utils.cc
  126. omaha_utils.h
  127. omaha_utils_unittest.cc
  128. p2p_manager.cc
  129. p2p_manager.h
  130. p2p_manager_unittest.cc
  131. parcelable_update_engine_status.cc
  132. parcelable_update_engine_status.h
  133. parcelable_update_engine_status_unittest.cc
  134. payload_state.cc
  135. payload_state.h
  136. payload_state_interface.h
  137. payload_state_unittest.cc
  138. power_manager_android.cc
  139. power_manager_android.h
  140. power_manager_chromeos.cc
  141. power_manager_chromeos.h
  142. power_manager_interface.h
  143. proxy_resolver.cc
  144. proxy_resolver.h
  145. proxy_resolver_unittest.cc
  146. pylintrc
  147. real_system_state.cc
  148. real_system_state.h
  149. run_unittests
  150. sample_omaha_v3_response.xml
  151. service_delegate_android_interface.h
  152. service_observer_interface.h
  153. shill_proxy.cc
  154. shill_proxy.h
  155. shill_proxy_interface.h
  156. sideload_main.cc
  157. system_state.h
  158. tar_bunzip2.gypi
  159. test_http_server.cc
  160. test_subprocess.cc
  161. testrunner.cc
  162. unittest_key.pem
  163. unittest_key2.pem
  164. update_attempter.cc
  165. update_attempter.h
  166. update_attempter_android.cc
  167. update_attempter_android.h
  168. update_attempter_android_unittest.cc
  169. update_attempter_unittest.cc
  170. update_engine-client.gyp
  171. update_engine.conf
  172. update_engine.gyp
  173. update_engine.rc
  174. update_engine_client.cc
  175. update_engine_client_android.cc
  176. update_metadata.proto
  177. update_status_utils.cc
  178. update_status_utils.h
  179. utils_android.cc
  180. utils_android.h