Changeset 4083c49 for util.c


Ignore:
Timestamp:
Aug 22, 2009, 12:49:20 AM (12 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
303a9e1
Parents:
f4d4a00
git-author:
Anders Kaseorg <andersk@mit.edu> (08/22/09 00:18:32)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/22/09 00:49:20)
Message:
Fix unchecked accesses to s[strlen(s) - 1].

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • util.c

    re30ed92 r4083c49  
    595595    /* strip the newline */
    596596    newline=0;
    597     if (buff[strlen(buff)-1]=='\n') {
     597    if (buff[0] != '\0' && buff[strlen(buff) - 1] == '\n') {
    598598      buff[strlen(buff)-1]='\0';
    599599      newline=1;
Note: See TracChangeset for help on using the changeset viewer.