off-by-one fix as reported by ogg.k.ogg.k and recently committed in
liboggz and oggenc
This commit is contained in:
parent
3e65d1e41e
commit
c280e0435a
1 changed files with 2 additions and 2 deletions
|
@ -28,9 +28,9 @@ int add_message_header_field(fisbone_packet *fp,
|
||||||
/* size of both key and value + ': ' + CRLF */
|
/* size of both key and value + ': ' + CRLF */
|
||||||
int this_message_size = strlen(header_key) + strlen(header_value) + 4;
|
int this_message_size = strlen(header_key) + strlen(header_value) + 4;
|
||||||
if (fp->message_header_fields == NULL) {
|
if (fp->message_header_fields == NULL) {
|
||||||
fp->message_header_fields = _ogg_calloc(this_message_size, sizeof(char));
|
fp->message_header_fields = _ogg_calloc(this_message_size+1, sizeof(char));
|
||||||
} else {
|
} else {
|
||||||
int new_size = (fp->current_header_size + this_message_size) * sizeof(char);
|
int new_size = (fp->current_header_size + this_message_size+1) * sizeof(char);
|
||||||
fp->message_header_fields = _ogg_realloc(fp->message_header_fields, new_size);
|
fp->message_header_fields = _ogg_realloc(fp->message_header_fields, new_size);
|
||||||
}
|
}
|
||||||
snprintf(fp->message_header_fields + fp->current_header_size,
|
snprintf(fp->message_header_fields + fp->current_header_size,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue