summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/lanman.c14
-rw-r--r--source3/smbd/mangle_hash.c5
-rw-r--r--source3/smbd/mangle_hash2.c2
-rw-r--r--source3/smbd/service.c5
4 files changed, 19 insertions, 7 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 1b5de57ad4..b22619ff35 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -4004,7 +4004,9 @@ static bool api_NetWkstaGetInfo(struct smbd_server_connection *sconn,
SIVAL(p,0,PTR_DIFF(p2,*rdata)); /* host name */
strlcpy(p2,get_local_machine_name(),PTR_DIFF(endp,p2));
- strupper_m(p2);
+ if (!strupper_m(p2)) {
+ return false;
+ }
p2 = skip_string(*rdata,*rdata_len,p2);
if (!p2) {
return False;
@@ -4021,7 +4023,9 @@ static bool api_NetWkstaGetInfo(struct smbd_server_connection *sconn,
SIVAL(p,0,PTR_DIFF(p2,*rdata)); /* login domain */
strlcpy(p2,lp_workgroup(),PTR_DIFF(endp,p2));
- strupper_m(p2);
+ if (!strupper_m(p2)) {
+ return false;
+ }
p2 = skip_string(*rdata,*rdata_len,p2);
if (!p2) {
return False;
@@ -4691,7 +4695,9 @@ static bool api_WWkstaUserLogon(struct smbd_server_connection *sconn,
fstring mypath;
fstrcpy(mypath,"\\\\");
fstrcat(mypath,get_local_machine_name());
- strupper_m(mypath);
+ if (!strupper_m(mypath)) {
+ return false;
+ }
PACKS(&desc,"z",mypath); /* computer */
}
@@ -5082,7 +5088,7 @@ static void fill_printdest_info(struct spoolss_PrinterInfo2 *info2, int uLevel,
strncpy(buf, info2->printername, sizeof(buf)-1);
buf[sizeof(buf)-1] = 0;
- strupper_m(buf);
+ (void)strupper_m(buf);
if (uLevel <= 1) {
PACKS(desc,"B9",buf); /* szName */
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c
index 056879c876..8a44ea2d6a 100644
--- a/source3/smbd/mangle_hash.c
+++ b/source3/smbd/mangle_hash.c
@@ -630,7 +630,10 @@ static bool to_8_3(char magic_char, const char *in, char out[13], int default_ca
} else
csum = str_checksum(s);
- strupper_m( s );
+ if (!strupper_m( s )) {
+ SAFE_FREE(s);
+ return false;
+ }
if( p ) {
if( p == s )
diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c
index 09cd44d5af..655c72745a 100644
--- a/source3/smbd/mangle_hash2.c
+++ b/source3/smbd/mangle_hash2.c
@@ -291,7 +291,7 @@ static unsigned int mangle_hash(const char *key, unsigned int length)
length = MIN(length,sizeof(fstring)-1);
strncpy(str, key, length);
str[length] = 0;
- strupper_m(str);
+ (void)strupper_m(str);
/* the length of a multi-byte string can change after a strupper_m */
length = strlen(str);
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 4fc1aa3e2d..ce9cff90e2 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -257,7 +257,10 @@ static NTSTATUS share_sanity_checks(const struct tsocket_address *remote_address
}
}
- strupper_m(dev);
+ if (!strupper_m(dev)) {
+ DEBUG(2,("strupper_m %s failed\n", dev));
+ return NT_STATUS_INVALID_PARAMETER;
+ }
if (lp_print_ok(snum)) {
if (!strequal(dev, "LPT1:")) {