Ver código fonte

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

tags/v0.9.3
Michael Brown 16 anos atrás
pai
commit
82bae302b1
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1
    1
      src/net/tcp/iscsi.c

+ 1
- 1
src/net/tcp/iscsi.c Ver arquivo

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

Carregando…
Cancelar
Salvar