diff options
author | Tim Potter <tpot@samba.org> | 2002-01-03 02:48:23 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-01-03 02:48:23 +0000 |
commit | af8ed1540118e61b7ed53547e564d839a1c8b2c6 (patch) | |
tree | 65c3609255c6b1f02916ca42147563a9747c7a8f | |
parent | 9164ed6220225ed14e167ba2166ad2f9ef7ba629 (diff) | |
download | samba-af8ed1540118e61b7ed53547e564d839a1c8b2c6.tar.gz samba-af8ed1540118e61b7ed53547e564d839a1c8b2c6.tar.bz2 samba-af8ed1540118e61b7ed53547e564d839a1c8b2c6.zip |
Fixed crash bug in display_print_info_1()
(This used to be commit d1564fbf1f4950c12516470d4566efeca3ad79e5)
-rw-r--r-- | source3/rpcclient/cmd_spoolss.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index f36669a777..74601563f2 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -184,9 +184,19 @@ static void display_print_info_1(PRINTER_INFO_1 *i1) fstring name; fstring comm; - rpcstr_pull(desc, i1->description.buffer, sizeof(desc), 0, STR_TERMINATE); - rpcstr_pull(name, i1->name.buffer, sizeof(name), 0, STR_TERMINATE); - rpcstr_pull(comm, i1->comment.buffer, sizeof(comm), 0, STR_TERMINATE); + desc[0] = name[0] = comm[0] = 0; + + if (i1->description.buffer) + rpcstr_pull(desc, i1->description.buffer, sizeof(desc), 0, + STR_TERMINATE); + + if (i1->name.buffer) + rpcstr_pull(name, i1->name.buffer, sizeof(name), 0, + STR_TERMINATE); + + if (i1->comment.buffer) + rpcstr_pull(comm, i1->comment.buffer, sizeof(comm), 0, + STR_TERMINATE); printf("\tflags:[0x%x]\n", i1->flags); printf("\tname:[%s]\n", name); |