summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/printing.c4
-rw-r--r--source3/rpc_parse/parse_spoolss.c12
2 files changed, 9 insertions, 7 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 56020f7838..ad17213c2d 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -850,7 +850,7 @@ static void store_queue_struct(struct tdb_print_db *pdb, struct traverse_struct
size_t i;
uint qcount;
- if (max_reported_jobs < pts->qcount)
+ if (max_reported_jobs && (max_reported_jobs < pts->qcount))
pts->qcount = max_reported_jobs;
qcount = pts->qcount;
@@ -2147,7 +2147,7 @@ static BOOL get_stored_queue_info(struct tdb_print_db *pdb, int snum, int *pcoun
len = 0;
for( i = 0; i < qcount; i++) {
uint32 qjob, qsize, qpage_count, qstatus, qpriority, qtime;
- len += tdb_unpack(data.dptr + 4 + len, data.dsize - len, NULL, "ddddddff",
+ len += tdb_unpack(data.dptr + 4 + len, data.dsize - len, "ddddddff",
&qjob,
&qsize,
&qpage_count,
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index 65f16414a0..7581316767 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -7294,11 +7294,13 @@ static BOOL spoolss_io_printer_enum_values_ctr(const char *desc, prs_struct *ps,
if (!prs_unistr("valuename", ps, depth, &ctr->values[i].valuename))
return False;
- if (UNMARSHALLING(ps) && ctr->values[i].data_len) {
- ctr->values[i].data = (uint8 *)prs_alloc_mem(
- ps, ctr->values[i].data_len);
- if (!ctr->values[i].data)
- return False;
+ if ( ctr->values[i].data_len ) {
+ if ( UNMARSHALLING(ps) ) {
+ ctr->values[i].data = (uint8 *)prs_alloc_mem(
+ ps, ctr->values[i].data_len);
+ if (!ctr->values[i].data)
+ return False;
+ }
if (!prs_uint8s(False, "data", ps, depth, ctr->values[i].data, ctr->values[i].data_len))
return False;
}