2001-10-22 Marcus Brinkmann <marcus@g10code.de>
* data.c (_gpgme_data_append): Check if LENGTH is smaller than ALLOC_CHUNK, not DH->length.
This commit is contained in:
parent
901bb49285
commit
2e9b689299
@ -1,3 +1,8 @@
|
|||||||
|
2001-10-22 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* data.c (_gpgme_data_append): Check if LENGTH is smaller than
|
||||||
|
ALLOC_CHUNK, not DH->length.
|
||||||
|
|
||||||
2001-10-17 Marcus Brinkmann <marcus@g10code.de>
|
2001-10-17 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* gpgme.c (gpgme_set_protocol): Fix last change.
|
* gpgme.c (gpgme_set_protocol): Fix last change.
|
||||||
|
15
gpgme/data.c
15
gpgme/data.c
@ -494,7 +494,7 @@ gpgme_data_rewind ( GpgmeData dh )
|
|||||||
* work for certain data types, all other will respond with an
|
* work for certain data types, all other will respond with an
|
||||||
* %GPGME_Invalid_Type.
|
* %GPGME_Invalid_Type.
|
||||||
*
|
*
|
||||||
* Return value: An errorcode or 0 on success, EOF is indcated by the
|
* Return value: An error code or 0 on success, EOF is indcated by the
|
||||||
* error code GPGME_EOF.
|
* error code GPGME_EOF.
|
||||||
**/
|
**/
|
||||||
GpgmeError
|
GpgmeError
|
||||||
@ -596,12 +596,12 @@ _gpgme_data_get_as_string ( GpgmeData dh )
|
|||||||
* gpgme_data_write:
|
* gpgme_data_write:
|
||||||
* @dh: the context
|
* @dh: the context
|
||||||
* @buffer: data to be written to the data object
|
* @buffer: data to be written to the data object
|
||||||
* @length: length o this data
|
* @length: length of this data
|
||||||
*
|
*
|
||||||
* Write the content of @buffer to the data object @dh at the current write
|
* Write the content of @buffer to the data object @dh at the current write
|
||||||
* position.
|
* position.
|
||||||
*
|
*
|
||||||
* Return value: 0 on succress or an errorcode
|
* Return value: 0 on success or an error code
|
||||||
**/
|
**/
|
||||||
GpgmeError
|
GpgmeError
|
||||||
gpgme_data_write ( GpgmeData dh, const char *buffer, size_t length )
|
gpgme_data_write ( GpgmeData dh, const char *buffer, size_t length )
|
||||||
@ -658,7 +658,7 @@ _gpgme_data_append ( GpgmeData dh, const char *buffer, size_t length )
|
|||||||
if ( dh->writepos + length > dh->private_len ) {
|
if ( dh->writepos + length > dh->private_len ) {
|
||||||
char *p;
|
char *p;
|
||||||
size_t newlen = dh->private_len
|
size_t newlen = dh->private_len
|
||||||
+ (dh->len < ALLOC_CHUNK? ALLOC_CHUNK : length);
|
+ (length < ALLOC_CHUNK? ALLOC_CHUNK : length);
|
||||||
p = xtryrealloc ( dh->private_buffer, newlen );
|
p = xtryrealloc ( dh->private_buffer, newlen );
|
||||||
if ( !p )
|
if ( !p )
|
||||||
return mk_error (Out_Of_Core);
|
return mk_error (Out_Of_Core);
|
||||||
@ -784,10 +784,3 @@ _gpgme_data_append_percentstring_for_xml ( GpgmeData dh, const char *string )
|
|||||||
xfree (buf);
|
xfree (buf);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user