~ubuntu-branches/ubuntu/natty/gnupg2/natty-security

« back to all changes in this revision

Viewing changes to common/iobuf.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2005-12-08 22:13:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051208221321-4rvs2vu835iam5wv
Tags: 1.9.19-2
* Convert debian/changelog to UTF-8.
* Put gnupg-agent and gpgsm lintian overrides in the respectively
  right package.  Closes: #335066
* Added debhelper tokens to maintainer scripts.
* xsession fixes:
  o Added host name to gpg-agent PID file name.  Closes: #312717
  o Fixed xsession script to be able to run under zsh.  Closes: #308516
  o Don't run gpg-agent if one is already running.  Closes: #336480
* debian/control:
  o Fixed package description of gpgsm package.  Closes: #299842
  o Added mention of gpg-agent to description of gnupg-agent package.
    Closes: #304355
* Thanks to Peter Eisentraut <petere@debian.org> for all of the above.

Show diffs side-by-side

added added

removed removed

Lines of Context:
675
675
 * without a filter
676
676
 */
677
677
static int
678
 
block_filter (void *opaque, int control, iobuf_t chain, byte * buf,
 
678
block_filter (void *opaque, int control, iobuf_t chain, byte * buffer,
679
679
              size_t * ret_len)
680
680
{
681
681
  block_filter_ctx_t *a = opaque;
 
682
  char *buf = (char *)buffer;
682
683
  size_t size = *ret_len;
683
684
  int c, needed, rc = 0;
684
685
  char *p;
1762
1763
 
1763
1764
  if (a->use == 3)
1764
1765
    {                           /* increase the temp buffer */
1765
 
      char *newbuf;
 
1766
      unsigned char *newbuf;
1766
1767
      size_t newsize = a->d.size + 8192;
1767
1768
 
1768
1769
      if (DBG_IOBUF)
1829
1830
 
1830
1831
 
1831
1832
int
1832
 
iobuf_read (iobuf_t a, byte * buf, unsigned buflen)
 
1833
iobuf_read (iobuf_t a, void *buffer, unsigned int buflen)
1833
1834
{
 
1835
  unsigned char *buf = (unsigned char *)buffer;
1834
1836
  int c, n;
1835
1837
 
1836
1838
  if (a->unget.buf || a->nlimit)
1915
1917
 
1916
1918
 
1917
1919
int
1918
 
iobuf_writebyte (iobuf_t a, unsigned c)
 
1920
iobuf_writebyte (iobuf_t a, unsigned int c)
1919
1921
{
1920
1922
  int rc;
1921
1923
 
1933
1935
 
1934
1936
 
1935
1937
int
1936
 
iobuf_write (iobuf_t a, byte * buf, unsigned buflen)
 
1938
iobuf_write (iobuf_t a, const void *buffer, unsigned int buflen)
1937
1939
{
 
1940
  const unsigned char *buf = (const unsigned char *)buffer;
1938
1941
  int rc;
1939
1942
 
1940
1943
  if (a->directfp)
2311
2314
                 unsigned *length_of_buffer, unsigned *max_length)
2312
2315
{
2313
2316
  int c;
2314
 
  char *buffer = *addr_of_buffer;
 
2317
  char *buffer = (char *)*addr_of_buffer;
2315
2318
  unsigned length = *length_of_buffer;
2316
2319
  unsigned nbytes = 0;
2317
2320
  unsigned maxlen = *max_length;
2321
2324
    {                           /* must allocate a new buffer */
2322
2325
      length = 256;
2323
2326
      buffer = xmalloc (length);
2324
 
      *addr_of_buffer = buffer;
 
2327
      *addr_of_buffer = (unsigned char *)buffer;
2325
2328
      *length_of_buffer = length;
2326
2329
    }
2327
2330
 
2344
2347
          length += 3;          /* correct for the reserved byte */
2345
2348
          length += length < 1024 ? 256 : 1024;
2346
2349
          buffer = xrealloc (buffer, length);
2347
 
          *addr_of_buffer = buffer;
 
2350
          *addr_of_buffer = (unsigned char *)buffer;
2348
2351
          *length_of_buffer = length;
2349
2352
          length -= 3;          /* and reserve again */
2350
2353
          p = buffer + nbytes;