"Fossies" - the Fresh Open Source Software Archive

Member "libsafe-2.0-16/exploits/t10.c" (19 Jun 2001, 460 Bytes) of package /linux/misc/old/libsafe-2.0-16.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*
    2  * $Name: release2_0-16 $
    3  * $Id: t10.c,v 1.4 2001/06/19 18:22:16 ttsai Exp $
    4  */
    5 
    6 
    7 /*
    8  * This is a worst-case performance program for libsafe.
    9  */
   10 
   11 
   12 void foo() {
   13     int     i, j;
   14     int     num_outer_loops = 10000;
   15     int     num_inner_loops = 1000;
   16     char    dest[1200];
   17     char    *src = "a";
   18 
   19     for (i=0; i<num_outer_loops; i++) {
   20     for (j=0; j<num_inner_loops; j++) {
   21         strcpy(dest, src);
   22     }
   23     }
   24 }
   25 
   26 int main() {
   27     foo();
   28 
   29     return 0;
   30 }