Backport from mainline
2019-09-26 Jonathan Wakely <jwakely@redhat.com>
* include/experimental/internet (operator==, operator<): Fix loop
condition to avoid reading past the end of the array.
From-SVN: r277378
2019-10-24 Jonathan Wakely <jwakely@redhat.com>
+ Backport from mainline
+ 2019-09-26 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/experimental/internet (operator==, operator<): Fix loop
+ condition to avoid reading past the end of the array.
+
Backport from mainline
2019-08-06 Jonathan Wakely <jwakely@redhat.com>
const auto& __aa = __a._M_bytes;
const auto& __bb = __b._M_bytes;
int __i = 0;
- for (; __aa[__i] == __bb[__i] && __i < 16; ++__i)
+ for (; __i < 16 && __aa[__i] == __bb[__i]; ++__i)
;
return __i == 16 ? __a.scope_id() == __b.scope_id() : false;
}
const auto& __aa = __a._M_bytes;
const auto& __bb = __b._M_bytes;
int __i = 0;
- for (; __aa[__i] == __bb[__i] && __i < 16; ++__i)
+ for (; __i < 16 && __aa[__i] == __bb[__i]; ++__i)
;
return __i == 16 ? __a.scope_id() < __b.scope_id() : __aa[__i] < __bb[__i];
}