mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-29 06:10:09 +08:00
Make 112_backtrace/bcheck_123 more robust
the strcat checker first checks dest for overlap, then src. If the padding byte between b[] and the pad[] arrays happens to be zero the dest check would have succeeded and the src test failed. If that padding byte would be zero the dest check would trigger first. As we can't influence the padding byte (only the b[] and pad[] arrays) it was random if the dest or src checks triggered. This makes it reliably trigger the dest check first.
This commit is contained in:
parent
2b7cffac74
commit
a5f6e6189e
@ -150,7 +150,7 @@ int main()
|
||||
#elif defined test_bcheck_122
|
||||
strcat(&a[7], &a[0]);
|
||||
#elif defined test_bcheck_123
|
||||
strcat(&a[0], &b[5]);
|
||||
strcat(&a[0], &b[3]);
|
||||
#elif defined test_bcheck_124
|
||||
strcat(&a[0], &a[4]);
|
||||
#elif defined test_bcheck_125
|
||||
|
@ -142,7 +142,7 @@
|
||||
|
||||
[test_bcheck_123]
|
||||
112_backtrace.c:153: at main: BCHECK: ........ is outside of the region
|
||||
112_backtrace.c:153: at main: BCHECK: invalid pointer ........, size 0x? in strcat src
|
||||
112_backtrace.c:153: at main: BCHECK: invalid pointer ........, size 0x? in strcat dest
|
||||
[returns 255]
|
||||
|
||||
[test_bcheck_124]
|
||||
|
Loading…
Reference in New Issue
Block a user