Stack Overflow

0

Znacie jakieś ciekawe sposoby przepełnienia stosu lub sterty?
Przykład rekurencyjnego zapełniania stosu z MSDN-a:

 
   //rekurencyjna nieskonczonosc - przepełnianie stosu
    class beka
    {
        private int a = 1;

        public override bool Equals(object obj)
        {
            if (obj is beka)
            {
                return this.Equals((beka)obj);
            }
            return false;
        }
    }

i wywołanie:

 
            beka bk = new beka();
            Boolean value=bk.Equals(bk);//tu następuje zwis i Buffer OverFlow
0
int** PSZEPEUNENIESTERTY = new int*[9999999];
for(int i = 0; i < 9999999; i++)
	PSZEPEUNENIESTERTY[i] = new int[9999999];
0

stos najprościej to chyba tak przepełnić:

int main()
{
  int tab[1000000][1000000];
  return 0;
}
0

Próbowałem, ale Visual studio mi powiedziało, że total size of array must not exceed 0x7fffffff bytes i IntelliSense: array is too large :P.

0

Przepełnia stos lub stertę:

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

int main(int argc, char const * * const argv) {
    char * const newString = strdup(argv[0]);
    argv[0] = newString;
    main(argc, argv);
    free(newString);
    return EXIT_SUCCESS;
}
0

Przepełnienie stosu/sterty to zupełnie coś innego niż buffer overflow

0

Kolejny przykład na StackOverflow

 public string w { get { return this.w; } set { this.w = value+"coca cola"; } } 
0
int foo() { return foo(); }

1 użytkowników online, w tym zalogowanych: 0, gości: 1