Abstract reader/writer issue with non-contigous input data
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- embedded-iot
Línea de trabajo
Comienza rastreando CborParserOperations y su función transfer_string a través de cbor_value_copy_text_string, y luego compara cómo se comportan cbor_value_advance y cbor_value_get_type para los dos objetos CborValue. Reproduce el ejemplo proporcionado de un iterador no contiguo, idealmente reduciéndolo a un caso mínimo; se considera terminado cuando el valor original y el siguiente valor de salida avanzan como se describe, sin CborErrorIllegalType.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
So I think this may be related to and/or covered by #208 , but I wanted to open an issue to report the specifics of what i am seeing.
I think the root of the issue is that in the structure CborParserOperations the function pointer transfer_string should advance the cursor but when calling CborError cbor_value_copy_text_string(const CborValue *value, char *buffer, size_t *buflen, CborValue *next) the cursor should be advanced for the output parameter next but not advanced in the in-out parameter value. I think the user data token* is shared between copies of CborValue.
I am working in an embedded system and transitioning some existing code to use a struct netbuff like structure instead of just copying around worst-case sized buffers. To do this i need to move all my code to work on iterators instead of just taking a std::span<uint8_t> (we are on C++20). The iterators to this new structure are bidirectional_iterator, so no random access.
A simple (exposition only) example of the code that fails:
detail::ParserState<InItr, S> cbor_parse;
CborValue it;
cbor_parse.init(data.begin(), data.end(), it);
CborValue it2;
char func_name_buff[10]{};
size_t name_len = 10;
if (!cbor_value_is_text_string(&it)) {
return BadValue;
}
if (auto err = cbor_value_copy_text_string(&it, func_name_buff, &name_len, &it2) != CborNoError) {
return err;
}
auto errr = cbor_value_advance(&it); // ERROR: CborErrorIllegalType
auto type = cbor_value_get_type(&it) // CborTextStringType, should be NullType after the advance
auto type2 = cbor_value_get_type(&it2) // CborNullType
I will work on getting a minimal reproducible example into compiler explorer, especially if this is a new case.
- Lenguaje dominante
- C
- Estrellas
- 634
- Forks
- 222
- Merge medio
- 1 d 25 min
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de intel/tinycbor
-
CborValidateTagUse rejects valid tag 1 (epoch) with a floating-point value, and restricts tags 21-23 too muchPosiblemente ocupada @thiagomacieira la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
CBOR validation not worksAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Fixing CI/CDAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Todos los issues de intel/tinycbor
Issues similares
-
Linux notifications: the default action's ' ' label shows as a blank button in xfce4-notifydAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
kovidgoyal/kitty#10625 ·
Los mantenedores suelen responder en 1 día
-
Feature Status: Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
RubyMetric/chsrc#396 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
riscv-software-src/riscv-isa-sim#2466 ·
Los mantenedores suelen responder en 1 día