[Xapian-tickets] [Xapian] #239: makedepend gets confused with multiple #include "filename..." in same program

Xapian nobody at xapian.org
Mon Mar 8 06:29:20 GMT 2010


#239: makedepend gets confused with multiple #include "filename..." in same
program
-------------------------------+--------------------------------------------
 Reporter:  caa                |        Owner:  caa      
     Type:  defect             |       Status:  reopened 
 Priority:  normal             |    Milestone:           
Component:  MSVC makefiles     |      Version:  SVN trunk
 Severity:  major              |   Resolution:           
 Keywords:                     |    Blockedby:           
 Platform:  Microsoft Windows  |     Blocking:           
-------------------------------+--------------------------------------------

Comment(by olly):

 Sorry for taking a while to get to this.

 I've applied the patch to trunk as r14132 (and also nuked the makedepend
 subdirectory).  I didn't commit the .sln and .vcproj files, as they don't
 seem to be used - xapdep.mak does the building here.  If they are needed
 let me know.

 I've eliminated 3 of the fixed sized buffers, two of which I'm pretty sure
 could be overflowed by suitable inputs.  Paul Rubin fixed makedepend's
 buffer overflows, and it would be a pity to replace it with something with
 new ones.  I'm only able to test compile with GCC, not to run, so I
 applied each small change separately so you can test them one by one if
 they don't work.  Sorry if I managed to break something.

 So:

 Fixed a potential buffer overflow in r14133.

 Eliminated another fixed sized buffer we could overflow in r14134.

 And eliminated depbuf in r14135 - I don't think we could overflow this
 one, but it's more obvious we can't if we don't have it!

 I also fixed a case of O(n*n) behaviour in r14136.  Probably not a big
 problem given the typical line length here, but silly to be needlessly
 slower like that.

 And finally I undoubled the contents of xapdep/README in r14137 (it and
 xapdep/xapdep.c were in your patch twice for some reason, but I only
 spotted the issue for xapdep.c before committing).

 One last issue is that the "myrename" function is taken with just small
 modifications from the makedepend code, but this isn't reflected in the
 (C) statements and licensing.  But it looks to me like this is just a
 clumsy workaround for not being able to rename a file over an existing
 one.  Assuming there aren't other issues involved, it would be cleaner and
 simpler to just remove the backup file explicitly first, like this:

 {{{
 #!cpp
 (void)unlink(BACKUP_MAKEFILE);
 if(rename(MAKEFILE,BACKUP_MAKEFILE)!=0)
     return -1;
 }}}

-- 
Ticket URL: <http://trac.xapian.org/ticket/239#comment:14>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list