snapshot: zero out entire siginfo_t
authorBrian Norris <banorris@uci.edu>
Tue, 5 Jun 2012 19:54:52 +0000 (12:54 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 5 Jun 2012 19:54:52 +0000 (12:54 -0700)
We should initialize this variable to all zeros, just to be safe.

snapshot.cc

index 2440b6e8bda8a06afa040475266e69d02094981e..ac4f712350aac33ab8f981b869d68a9500b4a76d 100644 (file)
@@ -155,8 +155,8 @@ void initSnapShotLibrary(unsigned int numbackingpages,
        // Solution is to call our signal handler before we start protecting stuff...
 
        siginfo_t si;
+       memset(&si, 0, sizeof(si));
        si.si_addr=ss.ss_sp;
-       si.si_code = 0;
        HandlePF(SIGSEGV, &si, NULL);
        snapshotrecord->lastBackingPage--; //remove the fake page we copied