Skip to content

Commit da2c88e

Browse files
authored
Merge pull request adafruit#1860 from godlygeek/int_to_bytes_overflow_checks
Add overflow checks for int to bytes conversions
2 parents 46164c6 + 6700728 commit da2c88e

22 files changed

+303
-83
lines changed

locale/ID.po

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2019-05-08 15:23-0700\n"
11+
"POT-Creation-Date: 2019-05-09 01:06-0400\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -52,8 +52,8 @@ msgstr ""
5252
msgid "%q indices must be integers, not %s"
5353
msgstr ""
5454

55-
#: shared-bindings/bleio/CharacteristicBuffer.c
5655
#: shared-bindings/displayio/Group.c shared-bindings/displayio/Shape.c
56+
#: shared-bindings/bleio/CharacteristicBuffer.c
5757
#, fuzzy
5858
msgid "%q must be >= 1"
5959
msgstr "buffers harus mempunyai panjang yang sama"
@@ -253,8 +253,8 @@ msgstr "Semua channel event yang disinkronisasi sedang digunakan"
253253
msgid "All timers for this pin are in use"
254254
msgstr "Semua timer untuk pin ini sedang digunakan"
255255

256-
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
257256
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
257+
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
258258
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
259259
#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c
260260
#: shared-module/_pew/PewPew.c
@@ -751,8 +751,8 @@ msgstr ""
751751
msgid "Input/output error"
752752
msgstr ""
753753

754-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
755754
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
755+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
756756
msgid "Invalid %q pin"
757757
msgstr "%q pada tidak valid"
758758

@@ -1076,8 +1076,8 @@ msgstr ""
10761076
msgid "Sample rate too high. It must be less than %d"
10771077
msgstr "Nilai sampel terlalu tinggi. Nilai harus kurang dari %d"
10781078

1079-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
10801079
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
1080+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
10811081
msgid "Serializer in use"
10821082
msgstr "Serializer sedang digunakan"
10831083

@@ -1216,8 +1216,8 @@ msgstr ""
12161216
msgid "Unable to allocate buffers for signed conversion"
12171217
msgstr "Tidak dapat mengalokasikan buffer untuk signed conversion"
12181218

1219-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
12201219
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
1220+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
12211221
msgid "Unable to find free GCLK"
12221222
msgstr "Tidak dapat menemukan GCLK yang kosong"
12231223

@@ -1709,7 +1709,7 @@ msgstr ""
17091709
msgid "empty"
17101710
msgstr ""
17111711

1712-
#: extmod/moduheapq.c extmod/modutimeq.c
1712+
#: extmod/modutimeq.c extmod/moduheapq.c
17131713
msgid "empty heap"
17141714
msgstr "heap kosong"
17151715

@@ -2586,6 +2586,11 @@ msgstr ""
25862586
msgid "unsupported types for %q: '%s', '%s'"
25872587
msgstr ""
25882588

2589+
#: py/objint.c
2590+
#, c-format
2591+
msgid "value would overflow a %d byte buffer"
2592+
msgstr ""
2593+
25892594
#: shared-bindings/displayio/Bitmap.c
25902595
msgid "value_count must be > 0"
25912596
msgstr ""

locale/circuitpython.pot

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2019-05-08 15:23-0700\n"
11+
"POT-Creation-Date: 2019-05-10 10:09-0700\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -2539,6 +2539,11 @@ msgstr ""
25392539
msgid "unsupported types for %q: '%s', '%s'"
25402540
msgstr ""
25412541

2542+
#: py/objint.c
2543+
#, c-format
2544+
msgid "value would overflow a %d byte buffer"
2545+
msgstr ""
2546+
25422547
#: shared-bindings/displayio/Bitmap.c
25432548
msgid "value_count must be > 0"
25442549
msgstr ""

locale/de_DE.po

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2019-05-08 15:23-0700\n"
10+
"POT-Creation-Date: 2019-05-09 01:06-0400\n"
1111
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
1212
"Last-Translator: Pascal Deneaux\n"
1313
"Language-Team: Sebastian Plamauer, Pascal Deneaux\n"
@@ -54,8 +54,8 @@ msgstr "Der Index %q befindet sich außerhalb der Reihung"
5454
msgid "%q indices must be integers, not %s"
5555
msgstr "%q Indizes müssen ganze Zahlen sein, nicht %s"
5656

57-
#: shared-bindings/bleio/CharacteristicBuffer.c
5857
#: shared-bindings/displayio/Group.c shared-bindings/displayio/Shape.c
58+
#: shared-bindings/bleio/CharacteristicBuffer.c
5959
msgid "%q must be >= 1"
6060
msgstr "%q muss >= 1 sein"
6161

@@ -253,8 +253,8 @@ msgstr "Alle sync event Kanäle werden benutzt"
253253
msgid "All timers for this pin are in use"
254254
msgstr "Alle timer für diesen Pin werden bereits benutzt"
255255

256-
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
257256
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
257+
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
258258
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
259259
#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c
260260
#: shared-module/_pew/PewPew.c
@@ -732,8 +732,8 @@ msgstr ""
732732
msgid "Input/output error"
733733
msgstr "Eingabe-/Ausgabefehler"
734734

735-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
736735
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
736+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
737737
msgid "Invalid %q pin"
738738
msgstr "Ungültiger %q pin"
739739

@@ -1063,8 +1063,8 @@ msgstr "Abtastrate muss positiv sein"
10631063
msgid "Sample rate too high. It must be less than %d"
10641064
msgstr "Abtastrate zu hoch. Wert muss unter %d liegen"
10651065

1066-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
10671066
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
1067+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
10681068
msgid "Serializer in use"
10691069
msgstr "Serializer wird benutzt"
10701070

@@ -1212,8 +1212,8 @@ msgstr "Der UUID-Wert ist kein str-, int- oder Byte-Puffer"
12121212
msgid "Unable to allocate buffers for signed conversion"
12131213
msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren"
12141214

1215-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
12161215
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
1216+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
12171217
msgid "Unable to find free GCLK"
12181218
msgstr "Konnte keinen freien GCLK finden"
12191219

@@ -1705,7 +1705,7 @@ msgstr "Division durch Null"
17051705
msgid "empty"
17061706
msgstr "leer"
17071707

1708-
#: extmod/moduheapq.c extmod/modutimeq.c
1708+
#: extmod/modutimeq.c extmod/moduheapq.c
17091709
msgid "empty heap"
17101710
msgstr "leerer heap"
17111711

@@ -2595,6 +2595,11 @@ msgstr "nicht unterstützter Typ für Operator"
25952595
msgid "unsupported types for %q: '%s', '%s'"
25962596
msgstr "nicht unterstützte Typen für %q: '%s', '%s'"
25972597

2598+
#: py/objint.c
2599+
#, c-format
2600+
msgid "value would overflow a %d byte buffer"
2601+
msgstr ""
2602+
25982603
#: shared-bindings/displayio/Bitmap.c
25992604
msgid "value_count must be > 0"
26002605
msgstr ""

locale/en_US.po

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2019-05-08 15:23-0700\n"
10+
"POT-Creation-Date: 2019-05-09 01:06-0400\n"
1111
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
1212
"Last-Translator: \n"
1313
"Language-Team: \n"
@@ -52,8 +52,8 @@ msgstr ""
5252
msgid "%q indices must be integers, not %s"
5353
msgstr ""
5454

55-
#: shared-bindings/bleio/CharacteristicBuffer.c
5655
#: shared-bindings/displayio/Group.c shared-bindings/displayio/Shape.c
56+
#: shared-bindings/bleio/CharacteristicBuffer.c
5757
msgid "%q must be >= 1"
5858
msgstr ""
5959

@@ -251,8 +251,8 @@ msgstr ""
251251
msgid "All timers for this pin are in use"
252252
msgstr ""
253253

254-
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
255254
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
255+
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
256256
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
257257
#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c
258258
#: shared-module/_pew/PewPew.c
@@ -726,8 +726,8 @@ msgstr ""
726726
msgid "Input/output error"
727727
msgstr ""
728728

729-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
730729
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
730+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
731731
msgid "Invalid %q pin"
732732
msgstr ""
733733

@@ -1046,8 +1046,8 @@ msgstr ""
10461046
msgid "Sample rate too high. It must be less than %d"
10471047
msgstr ""
10481048

1049-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
10501049
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
1050+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
10511051
msgid "Serializer in use"
10521052
msgstr ""
10531053

@@ -1183,8 +1183,8 @@ msgstr ""
11831183
msgid "Unable to allocate buffers for signed conversion"
11841184
msgstr ""
11851185

1186-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
11871186
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
1187+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
11881188
msgid "Unable to find free GCLK"
11891189
msgstr ""
11901190

@@ -1665,7 +1665,7 @@ msgstr ""
16651665
msgid "empty"
16661666
msgstr ""
16671667

1668-
#: extmod/moduheapq.c extmod/modutimeq.c
1668+
#: extmod/modutimeq.c extmod/moduheapq.c
16691669
msgid "empty heap"
16701670
msgstr ""
16711671

@@ -2539,6 +2539,11 @@ msgstr ""
25392539
msgid "unsupported types for %q: '%s', '%s'"
25402540
msgstr ""
25412541

2542+
#: py/objint.c
2543+
#, c-format
2544+
msgid "value would overflow a %d byte buffer"
2545+
msgstr ""
2546+
25422547
#: shared-bindings/displayio/Bitmap.c
25432548
msgid "value_count must be > 0"
25442549
msgstr ""

locale/en_x_pirate.po

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2019-05-08 15:23-0700\n"
10+
"POT-Creation-Date: 2019-05-09 01:06-0400\n"
1111
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
1212
"Last-Translator: \n"
1313
"Language-Team: @sommersoft, @MrCertainly\n"
@@ -54,8 +54,8 @@ msgstr ""
5454
msgid "%q indices must be integers, not %s"
5555
msgstr ""
5656

57-
#: shared-bindings/bleio/CharacteristicBuffer.c
5857
#: shared-bindings/displayio/Group.c shared-bindings/displayio/Shape.c
58+
#: shared-bindings/bleio/CharacteristicBuffer.c
5959
msgid "%q must be >= 1"
6060
msgstr ""
6161

@@ -253,8 +253,8 @@ msgstr ""
253253
msgid "All timers for this pin are in use"
254254
msgstr ""
255255

256-
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
257256
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
257+
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
258258
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
259259
#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c
260260
#: shared-module/_pew/PewPew.c
@@ -730,8 +730,8 @@ msgstr ""
730730
msgid "Input/output error"
731731
msgstr ""
732732

733-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
734733
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
734+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
735735
msgid "Invalid %q pin"
736736
msgstr "Avast! %q pin be invalid"
737737

@@ -1050,8 +1050,8 @@ msgstr ""
10501050
msgid "Sample rate too high. It must be less than %d"
10511051
msgstr ""
10521052

1053-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
10541053
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
1054+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
10551055
msgid "Serializer in use"
10561056
msgstr ""
10571057

@@ -1187,8 +1187,8 @@ msgstr ""
11871187
msgid "Unable to allocate buffers for signed conversion"
11881188
msgstr ""
11891189

1190-
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
11911190
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c
1191+
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
11921192
msgid "Unable to find free GCLK"
11931193
msgstr "Arr! No free GCLK be in sight"
11941194

@@ -1669,7 +1669,7 @@ msgstr ""
16691669
msgid "empty"
16701670
msgstr ""
16711671

1672-
#: extmod/moduheapq.c extmod/modutimeq.c
1672+
#: extmod/modutimeq.c extmod/moduheapq.c
16731673
msgid "empty heap"
16741674
msgstr ""
16751675

@@ -2543,6 +2543,11 @@ msgstr ""
25432543
msgid "unsupported types for %q: '%s', '%s'"
25442544
msgstr ""
25452545

2546+
#: py/objint.c
2547+
#, c-format
2548+
msgid "value would overflow a %d byte buffer"
2549+
msgstr ""
2550+
25462551
#: shared-bindings/displayio/Bitmap.c
25472552
msgid "value_count must be > 0"
25482553
msgstr ""

0 commit comments

Comments
 (0)