s3-printing: fix crash in printer_list_set_printer()
authorDavid Disseldorp <ddiss@samba.org>
Wed, 15 Feb 2012 15:30:27 +0000 (16:30 +0100)
committerKarolin Seeger <kseeger@samba.org>
Sat, 18 Feb 2012 18:46:57 +0000 (19:46 +0100)
The printer list database format was recently changed to accommodate for
the printcap location field.
One of the tdb_pack calls is not provided with a location string
argument, this causes a crash on some platforms.

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

source3/printing/printer_list.c

index d28278d069b4d535950d42fc58274807a0edc886..6ddd774d4f3c20eae53b54f59542c0ee17a686b2 100644 (file)
@@ -191,7 +191,7 @@ NTSTATUS printer_list_set_printer(TALLOC_CTX *mem_ctx,
        data.dsize = len;
 
        len = tdb_pack(data.dptr, data.dsize,
-                      PL_DATA_FORMAT, time_h, time_l, name, str);
+                      PL_DATA_FORMAT, time_h, time_l, name, str, str2);
 
        status = dbwrap_store_bystring_upper(db, key, data, TDB_REPLACE);