Back to index

glibc  2.9
Functions | Variables
vsprintf_chk.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "../libio/libioP.h"
#include "../libio/strfile.h"

Go to the source code of this file.


static int _IO_str_chk_overflow (_IO_FILE *fp, int c) __THROW
int ___vsprintf_chk (char *s, int flags, size_t slen, const char *format, va_list args)


static struct _IO_jump_t

Function Documentation

int ___vsprintf_chk ( char *  s,
int  flags,
size_t  slen,
const char *  format,
va_list  args 

Definition at line 65 of file vsprintf_chk.c.

  _IO_strfile f;
  int ret;
#ifdef _IO_MTSAFE_IO
  f._sbf._f._lock = NULL;

  if (slen == 0)
    __chk_fail ();

  _IO_no_init (&f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
  _IO_JUMPS ((struct _IO_FILE_plus *) &f._sbf) = &_IO_str_chk_jumps;
  s[0] = '\0';
  _IO_str_init_static_internal (&f, s, slen - 1, s);

  /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n
     can only come from read-only format strings.  */
  if (flags > 0)
    f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;

  ret = INTUSE(_IO_vfprintf) ((_IO_FILE *) &f._sbf, format, args);

  *f._sbf._f._IO_write_ptr = '\0';
  return ret;

Here is the call graph for this function:

static int _IO_str_chk_overflow ( _IO_FILE fp,
int  c 
) [static]

Definition at line 29 of file vsprintf_chk.c.

  /* When we come to here this means the user supplied buffer is
     filled.  */
  __chk_fail ();

Here is the call graph for this function:

Variable Documentation

struct _IO_jump_t [static]