From 8e579f27d6d48260d8d52d56da3e08b1ed81bdd4 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 28 Jan 2019 16:14:31 +0100 Subject: prog: fix escaping of C strings C's \xHH hex constants in strings accept any number of hex digits (not just 2 or 4). So later non-hex escaped chars glue to the \x construct. Use \OOO instead as it accepts at most 3 octal digits. --- sys/test/test/strings | 1 + 1 file changed, 1 insertion(+) (limited to 'sys') diff --git a/sys/test/test/strings b/sys/test/test/strings index 5b665ba5a..19af70fd7 100644 --- a/sys/test/test/strings +++ b/sys/test/test/strings @@ -1,3 +1,4 @@ syz_compare(&AUTO="303100090a0d7022273a", 0xa, &AUTO=@str='01\x00\t\n\rp\"\':', AUTO) syz_compare(&AUTO="303100090a0d7022273a01", 0xb, &AUTO=@blob='01\x00\t\n\rp\"\':\x01', AUTO) syz_compare(&AUTO="303100090a0d7022273a0102", 0xc, &AUTO=@arr16be=[0x3031, 0x0009, 0x0a0d, 0x7022, 0x273a, 0x0102], AUTO) +syz_compare(&AUTO="e91f6189591e9233614b00", 0xb, &AUTO=@str='\xe9\x1fa\x89Y\x1e\x923aK\x00', AUTO) -- cgit mrf-deployment