Incidencia #38557

read_blocks may return fewer bytes on eof

Abrir Fecha: 2018-08-29 20:27 Última actualización: 2018-08-29 20:27

Informador:
Propietario:
Tipo:
Estado:
Open [Owner assigned]
Componente:
(Ninguno)
Hito:
(Ninguno)
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Ninguno
Fichero:
Ninguno

Details

arbitrary_positional_facade.hpp line 325 may result in res less than n at end of file. Specifically this code at lines 330 and 331:

					count_ = block_size_ - n;
					total += n;
leaves count_ with residual bytes when there are none such that a subsequent call to read will return data when no data is available. I believe these should be something along the lines of:
					if (res > n)
					{
						count_ = res - n;
						total += n;
					}
					else
					{
						count_ = 0;
						total += res;
					}
Thus if block size is say 3 and only 2 bytes are read at the end of file there will not be a residual of 1 byte for the next call to read. Rather, the next call will return the expected 0 bytes indicating end of file.

Ticket History (1/1 Histories)

2018-08-29 20:27 Updated by: nivekkagicom
  • New Ticket "read_blocks may return fewer bytes on eof" created

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Entrar