Skip to content

Commit d367cb9

Browse files
Dan Carpentersmfrench
authored andcommitted
cifs: remove bogus debug code
The "end" pointer is either NULL or it points to the next byte to parse. If there isn't a next byte then dereferencing "end" is an off-by-one out of bounds error. And, of course, if it's NULL that leads to an Oops. Printing "*end" doesn't seem very useful so let's delete this code. Also for the last debug statement, I noticed that it should be printing "sequence_end" instead of "end" so fix that as well. Reported-by: Dominik Maier <dmaier@sect.tu-berlin.de> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 1af34fd commit d367cb9

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

fs/cifs/asn1.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,8 @@ decode_negTokenInit(unsigned char *security_blob, int length,
530530
return 0;
531531
} else if ((cls != ASN1_CTX) || (con != ASN1_CON)
532532
|| (tag != ASN1_EOC)) {
533-
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
534-
cls, con, tag, end, *end);
533+
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p exit 0\n",
534+
cls, con, tag, end);
535535
return 0;
536536
}
537537

@@ -541,8 +541,8 @@ decode_negTokenInit(unsigned char *security_blob, int length,
541541
return 0;
542542
} else if ((cls != ASN1_UNI) || (con != ASN1_CON)
543543
|| (tag != ASN1_SEQ)) {
544-
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
545-
cls, con, tag, end, *end);
544+
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p exit 1\n",
545+
cls, con, tag, end);
546546
return 0;
547547
}
548548

@@ -552,8 +552,8 @@ decode_negTokenInit(unsigned char *security_blob, int length,
552552
return 0;
553553
} else if ((cls != ASN1_CTX) || (con != ASN1_CON)
554554
|| (tag != ASN1_EOC)) {
555-
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 0\n",
556-
cls, con, tag, end, *end);
555+
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p exit 0\n",
556+
cls, con, tag, end);
557557
return 0;
558558
}
559559

@@ -564,8 +564,8 @@ decode_negTokenInit(unsigned char *security_blob, int length,
564564
return 0;
565565
} else if ((cls != ASN1_UNI) || (con != ASN1_CON)
566566
|| (tag != ASN1_SEQ)) {
567-
cifs_dbg(FYI, "cls = %d con = %d tag = %d end = %p (%d) exit 1\n",
568-
cls, con, tag, end, *end);
567+
cifs_dbg(FYI, "cls = %d con = %d tag = %d sequence_end = %p exit 1\n",
568+
cls, con, tag, sequence_end);
569569
return 0;
570570
}
571571

0 commit comments

Comments
 (0)