summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-09-17 18:04:05 +1000
committerGünther Deschner <gd@samba.org>2010-09-20 16:15:11 -0700
commit03011bf11837e75474f91f422ddf35d827d31cd1 (patch)
tree88b95ddb102a24dec0035322db802391b1b33f7f /source3/printing
parent6acb47b1154562415bf966f72262481d25e58708 (diff)
downloadsamba-03011bf11837e75474f91f422ddf35d827d31cd1.tar.gz
samba-03011bf11837e75474f91f422ddf35d827d31cd1.tar.bz2
samba-03011bf11837e75474f91f422ddf35d827d31cd1.zip
s3-libads call common GUID_from_ndr_blob()
This does a length-limited check, and so avoids reading beyond the allocated memory if the server sends less than 16 bytes. Andrew Bartlett Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing_ads.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/printing/nt_printing_ads.c b/source3/printing/nt_printing_ads.c
index 4b39173c3e..56086c9e89 100644
--- a/source3/printing/nt_printing_ads.c
+++ b/source3/printing/nt_printing_ads.c
@@ -187,10 +187,13 @@ static WERROR nt_printer_publish_ads(struct messaging_context *msg_ctx,
/* retreive the guid and store it locally */
if (ADS_ERR_OK(ads_search_dn(ads, &res, prt_dn, attrs))) {
+ bool guid_ok;
ZERO_STRUCT(guid);
- ads_pull_guid(ads, res, &guid);
+ guid_ok = ads_pull_guid(ads, res, &guid);
ads_msgfree(ads, res);
- store_printer_guid(msg_ctx, printer, guid);
+ if (guid_ok) {
+ store_printer_guid(msg_ctx, printer, guid);
+ }
}
TALLOC_FREE(ctx);