progs/test1.c
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Thu, 15 Dec 2016 16:13:36 +0000
changeset 504 fd7f1ca1963f
parent 208 204564b899a0
permissions -rw-r--r--
added

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

void foo (char *bar)
{
   long my_long = 101010101;    // in hex: \xB5\x4A\x05\x06
}
 
int main (int argc, char **argv)
{
  foo("my string is too long !!!!!");                  // all is normal
  foo("my string is too long !!!!! \x15\xcd\x5b\x07"); // overwrites my_long
  return 0;
}