正在加载图片...
Stack Buffers Suppose Web server contains this function void func(char *str){ Allocate local buffer char buf[126]; (126 bytes reserved on stack) strcpy(buf,str) Copy argument into local buffer When this function is invoked,a new frame with local variables is pushed onto the stack Stack grows this way buf ret sfp rame of the。 Top of addr str calling function stack Local variables Pointer to Execute Arguments previous code at frame this address after func() finishes 55 Stack Buffers  Suppose Web server contains this function void func(char *str) { char buf[126]; strcpy(buf,str); }  When this function is invoked, a new frame with local variables is pushed onto the stack Allocate local buffer (126 bytes reserved on stack) Copy argument into local buffer Top of stack Stack grows this way buf sfp ret addr str Local variables Frame of the calling function Execute code at this address after func() finishes Pointer to Arguments previous frame
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有