buffer overflow

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • raashid bhatt

    buffer overflow

    do buffer overflow happens with global variables
  • Nick Keighley

    #2
    Re: buffer overflow

    On 19 Aug, 14:53, raashid bhatt <raashidbh...@g mail.comwrote:
    do buffer overflow happens with global variables
    I think you're going to have to expand your question.
    Do you mean

    1. can overflow occur with global variables?
    2. can buffer overflow *only* happen with GVs?
    3. do BOs *always* happen with GVs?

    int ga [10];
    int gi = 11;

    int main (void)
    {
    int a;
    int i = 12;

    gi = 11;
    ga[gi] = 0; /* 1 */
    ga[i] = 0 /* 1 */
    a[gi] = 0; /* 2 */
    a[i] = 0; /* 2 */

    i = 0;
    gi = 1;
    a[i] = 0; /* 3 */
    ga[gi] = 0; /* 3 */

    return 0;
    }

    now, why did you ask the question? What answer did you expect?


    --
    Nick Keighley





    Comment

    • santosh

      #3
      Re: buffer overflow

      raashid bhatt wrote:
      do buffer overflow happens with global variables
      Yes, they can.

      Comment

      • Daniel Molina Wegener

        #4
        Re: buffer overflow

        On Aug 19, 9:53 am, raashid bhatt <raashidbh...@g mail.comwrote:
        do buffer overflow happens with global variables
        Global, local, static, and any variable...
        If you understand what a buffer overflow means, it
        can occur on any non insufficient allocated memory
        block or wrong handled memory block size, such as
        integer overflows...

        Regards,
        DMW

        Comment

        • Richard W

          #5
          Re: buffer overflow

          do buffer overflow happens with global variables

          Sure

          Comment

          Working...