Re: security checkup in source control software

[email protected]
Newsgroups gmane.comp.security.programming
Message-ID <[email protected]>
On Fri, 16 Apr 2004 16:34:12 EDT, Jose Nazario said:
> provided you can do arbitrary checks on what was checked in, you can do
> them. just invoke the checking program either on the (positive, stuff
> you're adding) diff or on the resulting source code.

You need to rescan the resulting source code.  There are many failure
modes where the diff itself will be "clean", but the resulting code isn't.

Here's the diff for a contrived example:

*** demo.c.dist 2004-04-16 17:54:23.155185181 -0400
--- demo.c      2004-04-16 17:54:39.340407270 -0400
***************
*** 2,7 ****
--- 2,8 ----
        bindex[i] = rigthptr(i,24);
        if (compare(j,ptr2) > 5) {
                redo_left = 1;
+               lastptr = -1;
                if (compare(j,ptr1) > 7) {
                        redo_right = 1;
                }


Safe?  Looks OK to me, but let's look at more code:

        aindex[i] = leftptr(j,23);
        bindex[i] = rigthptr(i,24);
        if (compare(j,ptr2) > 5) {
                redo_left = 1;
                lastptr = -1;
                if (compare(j,ptr1) > 7) {
                        redo_right = 1;
                }
                rebalance(aindex,bindex,redo_left,redo_right);
        }
        /* Now we do other stuff */
        thinko[lastptr] = sum_value(aindex,bindex);
signature.asc (application/pgp-signature, 226 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh version 2.5 07/13/2001

iD8DBQFAgFZ7cC3lWbTT17ARApVHAJoCIRCy4Jj6ZLXiOB+Z3IZVV98fQwCfZEGC
GWZ0h95tLstc+tDPCZkFmvM=
=QSM/
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.