Commit c1394cd
authored
Fix missing index check for Tokenizer_GetArg functions (#2058)
* Fix missing "safeguard" for invalid iargument index for
Tokenizer_GetArgIntegerRange() need to agree an return value in this cas. I choosed range_Min
Tokenizer_GetArgInteger()
Tokenizer_GetArgFloat()
Added check for negative index to all TokenizerGetXX functions
Added selftest for these cases to selftest_tokenizer.c
Tried to fix selftest_tasmota.c - it relayed on the previous behavior to return a value from a prevoius "TokenizeString()" call
Examlpe of what was changed:
- SIM_SendFakeMQTTAndRunSimFrame_CMND("CT", "");
+ SIM_SendFakeMQTTAndRunSimFrame_CMND("CT", "153");
(later 153 is used for "assert" in
SELFTEST_ASSERT_JSON_VALUE_INTEGER(0, "CT", 153);
)
* revert modifications to tasmota selftests.
Safeguarding command in src/cmnds/cmd_newLEDDriver.c (reject calls with insufficient number of arguments)
Make "0" default "addMode" for "add_dimmer()"
* Add some more checks. Hopefully it's complete now1 parent efd383a commit c1394cd
4 files changed
Lines changed: 71 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
916 | | - | |
917 | | - | |
| 915 | + | |
918 | 916 | | |
919 | | - | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
920 | 921 | | |
921 | | - | |
922 | 922 | | |
923 | | - | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
924 | 926 | | |
925 | 927 | | |
926 | 928 | | |
| |||
994 | 996 | | |
995 | 997 | | |
996 | 998 | | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
997 | 1002 | | |
998 | 1003 | | |
999 | 1004 | | |
| |||
1178 | 1183 | | |
1179 | 1184 | | |
1180 | 1185 | | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
1181 | 1189 | | |
1182 | 1190 | | |
1183 | 1191 | | |
| |||
1191 | 1199 | | |
1192 | 1200 | | |
1193 | 1201 | | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
1194 | 1205 | | |
1195 | 1206 | | |
1196 | | - | |
| 1207 | + | |
1197 | 1208 | | |
1198 | 1209 | | |
1199 | 1210 | | |
| |||
1204 | 1215 | | |
1205 | 1216 | | |
1206 | 1217 | | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
1207 | 1221 | | |
1208 | 1222 | | |
1209 | 1223 | | |
| |||
1383 | 1397 | | |
1384 | 1398 | | |
1385 | 1399 | | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
1386 | 1403 | | |
1387 | 1404 | | |
1388 | 1405 | | |
| |||
1583 | 1600 | | |
1584 | 1601 | | |
1585 | 1602 | | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
1586 | 1606 | | |
1587 | 1607 | | |
1588 | 1608 | | |
| |||
1672 | 1692 | | |
1673 | 1693 | | |
1674 | 1694 | | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
1675 | 1698 | | |
1676 | 1699 | | |
1677 | 1700 | | |
| |||
1692 | 1715 | | |
1693 | 1716 | | |
1694 | 1717 | | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
1695 | 1721 | | |
1696 | 1722 | | |
1697 | 1723 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
203 | 213 | | |
204 | 214 | | |
205 | 215 | | |
| |||
227 | 237 | | |
228 | 238 | | |
229 | 239 | | |
230 | | - | |
| 240 | + | |
231 | 241 | | |
232 | 242 | | |
233 | 243 | | |
| |||
237 | 247 | | |
238 | 248 | | |
239 | 249 | | |
240 | | - | |
| 250 | + | |
241 | 251 | | |
242 | 252 | | |
243 | 253 | | |
| |||
247 | 257 | | |
248 | 258 | | |
249 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
250 | 263 | | |
251 | 264 | | |
252 | 265 | | |
| |||
278 | 291 | | |
279 | 292 | | |
280 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
281 | 297 | | |
282 | 298 | | |
283 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
138 | 156 | | |
139 | 157 | | |
140 | 158 | | |
0 commit comments