1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-21 18:04:06 +03:00
Stefan Metzmacher 9be924f907 s4:torture/ndr: demonstrate the ndr_push_string(STR_NOTERM|REMAINING) of "" is wrong
convert_string_talloc() never returns a string with len=0 and always
implies zero termination byte(s).

For ndr_push_string this is unexpected as we need to be compatible on
the wire and push 0 bytes for an empty string.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14956

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 8da26cb6725b5d853ab481a348a3a672966715b5)
2022-01-30 10:57:11 +00:00
..
2016-02-06 21:48:18 +01:00
2015-03-20 20:43:12 +01:00
2021-07-14 16:49:29 +00:00
2021-07-14 16:49:29 +00:00
2013-03-15 13:51:51 +01:00
2016-02-06 21:48:18 +01:00

use
	hexdump -v -e '12/1 "0x%02x, " "\n"' infile|outfile

to import ndr dumps


Or use gdb:

(gdb) b dump_printer
Breakpoint 1 at 0x49c92f: file ../source3/utils/net_printing.c, line 158.
(gdb) cond 1 strcmp(key_name, "s0bc") == 0
(gdb) run
Breakpoint 1, dump_printer (mem_ctx=0x700a20, key_name=0x11fb8f9 "s0bc", data=0x18f93d0 "H\032", length=1284, do_string_conversion=true) at ../source3/utils/net_printing.c:158
158             printf("found printer: %s\n", key_name);

-> Now use x/<length in byte>bx

(gdb) x/1284bx data

This prints data as hex values. 1284 is the length in byte (see the length
argument of the function). The b indicates byte.