Skip to content
Snippets Groups Projects
Commit 17b7aee1 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use smb_msg_type() to double-check the header type against attribute flags.

The inferred message type should match the stored message type. Confirm that.
parent c018dfb8
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -158,7 +158,7 @@ int main(int argc, char **argv)
,hasherr,badhash
,acthdrblocks,actdatblocks
,dfieldlength,dfieldoffset
,dupenum,dupenumhdr,dupeoff,attr,actalloc
,dupenum,dupenumhdr,dupeoff,attr,actalloc,types
,datactalloc,misnumbered,timeerr,idxofferr,idxerr
,subjcrc,fromcrc,tocrc
,intransit,unvalidated
......@@ -349,6 +349,7 @@ int main(int argc, char **argv)
}
headers=deleted=orphan=dupenumhdr=attr=zeronum=timeerr=lockerr=hdrerr=0;
types = 0;
subjcrc=fromcrc=tocrc=0;
hdrnumerr=hdrlenerr=0;
actalloc=datactalloc=deldatblocks=delhdrblocks=xlaterr=0;
......@@ -471,6 +472,13 @@ int main(int argc, char **argv)
}
}
if(msg.hdr.type != smb_msg_type(msg.hdr.attr)) {
fprintf(stderr,"%sMessage type mismatch (%d, expected %d)\n"
,beep, msg.hdr.type, smb_msg_type(msg.hdr.attr));
msgerr=TRUE;
types++;
}
if(!(smb.status.attr&SMB_EMAIL) && chkhash) {
/* Look-up the message hashes */
hashes=smb_msghashes(&msg,(uchar*)body,SMB_HASH_SOURCE_DUPE);
......@@ -1015,6 +1023,10 @@ int main(int argc, char **argv)
printf("%-35.35s (!): %lu\n"
,"Mismatched Header Lengths"
,hdrlenerr);
if(types)
printf("%-35.35s (!): %lu\n"
,"Mismatched Attribute/MsgTypes"
,types);
#define INDXERR "Index/Header Mismatch: "
if(attr)
printf("%-35.35s (!): %lu\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment