~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to bufaux.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-09-30 23:09:58 UTC
  • mfrom: (1.13.3 upstream) (29 hardy)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20080930230958-o6vsgn8c4mm959s0
Tags: 1:5.1p1-3
* Remove unnecessary ssh-vulnkey output in non-verbose mode when no
  compromised or unknown keys were found (closes: #496495).
* Configure with --disable-strip; dh_strip will deal with stripping
  binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link;
  closes: #498681).
* Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
  #497026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenBSD: bufaux.c,v 1.44 2006/08/03 03:34:41 deraadt Exp $ */
 
1
/* $OpenBSD: bufaux.c,v 1.46 2008/06/10 23:21:34 dtucker Exp $ */
2
2
/*
3
3
 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4
4
 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
180
180
                return (NULL);
181
181
        }
182
182
        /* Append a null character to make processing easier. */
183
 
        value[len] = 0;
 
183
        value[len] = '\0';
184
184
        /* Optionally return the length of the string. */
185
185
        if (length_ptr)
186
186
                *length_ptr = len;
197
197
        return (ret);
198
198
}
199
199
 
 
200
void *
 
201
buffer_get_string_ptr(Buffer *buffer, u_int *length_ptr)
 
202
{
 
203
        void *ptr;
 
204
        u_int len;
 
205
 
 
206
        len = buffer_get_int(buffer);
 
207
        if (len > 256 * 1024)
 
208
                fatal("buffer_get_string_ptr: bad string length %u", len);
 
209
        ptr = buffer_ptr(buffer);
 
210
        buffer_consume(buffer, len);
 
211
        if (length_ptr)
 
212
                *length_ptr = len;
 
213
        return (ptr);
 
214
}
 
215
 
200
216
/*
201
217
 * Stores and arbitrary binary string in the buffer.
202
218
 */