stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Farid Zaripov <>
Subject Environment for the test of the string functions memory overrun with example
Date Fri, 07 Jul 2006 14:13:23 GMT

   rw_test_overrun.h contains declaration of the class test_string and 
#defines used for testing for the memory overrun.
   rw_test_overrun.cpp contains definition of the class test_string and 
static utility functions.

   rwmatch_test.cpp - example of using test_string in tests.

   Main idea of the test is create string buffer, protected on the end, 
and pass this buffer to the function which is tested to the correctness 
memory addressing. Also test_string class contains method protect which 
can used for check that the any function fun (const char * str) really 
doen't modify the content of the string (i.e fun accesses the str only 
for read; detected even non-modifying writes like str[0] = str[0]).


View raw message