summaryrefslogtreecommitdiffstatshomepage
path: root/py/sequence.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/sequence.c')
-rw-r--r--py/sequence.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/sequence.c b/py/sequence.c
index 63f6bd6944..3d2bbba4df 100644
--- a/py/sequence.c
+++ b/py/sequence.c
@@ -83,6 +83,10 @@ bool m_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, machine_ui
// Special-case comparison function for sequences of bytes
// Don't pass MP_BINARY_OP_NOT_EQUAL here
bool mp_seq_cmp_bytes(int op, const byte *data1, uint len1, const byte *data2, uint len2) {
+ if (op == MP_BINARY_OP_EQUAL && len1 != len2) {
+ return false;
+ }
+
// Let's deal only with > & >=
if (op == MP_BINARY_OP_LESS || op == MP_BINARY_OP_LESS_EQUAL) {
SWAP(const byte*, data1, data2);