Menu

#155 dlhandler_unix.cpp minor buffer over-run

2.0.x
closed
8
2012-10-23
2006-05-23
Anonymous
No

src/dlhandler_unix.cpp in openbabel 2.0.1 contains
in the function DLHandler::findFiles

char buffer[BUFF_SIZE];

[...]

buffer[BUFF_SIZE] = '\0';

I suggest the first line be replaced with

char buffer[BUFF_SIZE+1];

to make the subscript valid.

MJR

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Um, actually, perhaps buffer[BUFF_SIZE-1] = '\0'; would
    be rather better.

    MJR

     
  • Geoff Hutchison

    Geoff Hutchison - 2006-05-24

    Logged In: YES
    user_id=21420

    Thanks, I just fixed this in the development trunk and 2.0.x branch -- it'll
    definitely go into 2.0.2 soon.

    Cheers,
    -Geoff