sshnet / sshnet/SSH.NET

Issue with NetConf : ArgumentOutOfRangeException

Abierto
#69 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
C#
Estrellas
4.4k
Forks
993
Merge medio
9 d 21 h
PR fusionados (30 d)
1

Descripción

When an rpc-reply message is received, this exception is thrown in NetconfSession.OnDataReceived event handler.
The cause is that the received data length is 1015 byte, and the decoded message string contains a magic number at the beginning as below:
#1585

....

This number is matched with a regex then is used to append this length of data to a stringbuilder, namely to _rpcreply object, like :

var match = Regex.Match(chunk.Substring(position), @"\n#(?<length>\d+)\n");
if (!match.Success)
{
  break;
}
var fractionLength = Convert.ToInt32(match.Groups["length"].Value);
_rpcReply.Append(chunk, position + match.Index + match.Length, fractionLength);

where the value of position is the number at the beginning of the message, that is, 1585 in this example.
It is obvious that the Append operation will fail as one can't append 1585 byte from an 1015 byte length string.

What I can't figure out is where this magic number is coming from, as RFC6241 apparently does not contain such - lets call it - segment length element ? So where is it coming from, can anyone tell ?

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza en NetconfSession.OnDataReceived, centrándote en la expresión regular que lee el marcador #length y en la operación de anexado de _rpcReply. Compara este framing con la especificación NETCONF relevante e inspecciona cómo se dividen los chunks recibidos. Se considera terminado cuando se haya identificado el origen del marcador y resuelto el fallo out-of-range del rpc-reply reportado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp
Área
networking
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.