Browse Source

Fix off-by-one error (discovered by Shao Miller).

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
82bae302b1
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/net/tcp/iscsi.c

+ 1
- 1
src/net/tcp/iscsi.c View File

684
 	/* Process challenge an octet at a time */
684
 	/* Process challenge an octet at a time */
685
 	for ( ; ( value[0] && value[1] ) ; value += 2 ) {
685
 	for ( ; ( value[0] && value[1] ) ; value += 2 ) {
686
 		memcpy ( buf, value, 2 );
686
 		memcpy ( buf, value, 2 );
687
-		buf[3] = 0;
687
+		buf[2] = 0;
688
 		byte = strtoul ( buf, &endp, 16 );
688
 		byte = strtoul ( buf, &endp, 16 );
689
 		if ( *endp != '\0' ) {
689
 		if ( *endp != '\0' ) {
690
 			DBGC ( iscsi, "iSCSI %p saw invalid CHAP challenge "
690
 			DBGC ( iscsi, "iSCSI %p saw invalid CHAP challenge "

Loading…
Cancel
Save