Skip to content
Snippets Groups Projects
Commit 2188016f authored by rswindell's avatar rswindell
Browse files

smb_getmsghdr() no longer returns error (SMB_ERR_HDR_FIELD) if one of the

required header fields (to/from/subj) is missing. Instead, it just points the
convenience pointer(s) for the missing field(s) to a static null string.
Increased version to 2.22.
parent ae226a32
No related branches found
No related tags found
No related merge requests found
......@@ -68,10 +68,12 @@
#include "filewrap.h"
/* Use smb_ver() and smb_lib_ver() to obtain these values */
#define SMBLIB_VERSION "2.21" /* SMB library version */
#define SMBLIB_VERSION "2.22" /* SMB library version */
#define SMB_VERSION 0x0121 /* SMB format version */
/* High byte major, low byte minor */
static char* nulstr="";
int SMBCALL smb_ver(void)
{
return(SMB_VERSION);
......@@ -967,11 +969,10 @@ int SMBCALL smb_getmsghdr(smb_t* smb, smbmsg_t* msg)
l+=msg->hfield[i].length;
}
if(!msg->from || !msg->to || !msg->subj) {
sprintf(smb->last_error,"missing required header field (from/to/subj)");
smb_freemsgmem(msg);
return(SMB_ERR_HDR_FIELD);
}
/* These convenience pointers must point to something */
if(msg->from==NULL) msg->from=nulstr;
if(msg->to==NULL) msg->to=nulstr;
if(msg->subj==NULL) msg->subj=nulstr;
/* If no reverse path specified, use sender's address */
if(msg->reverse_path == NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment