Changeset 4083c49 for zephyr.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
  • zephyr.c

    r27f6487 r4083c49  
    378378  if (file) {
    379379    while ( fgets(buffer, 1024, file)!=NULL ) {
    380       if (buffer[0]=='#' || buffer[0]=='\n' || buffer[0]=='\n') continue;
     380      if (buffer[0] == '\0' || buffer[0] == '#' || buffer[0] == '\n') continue;
    381381     
    382382      if (count == numSubs) {
     
    385385      }
    386386
    387       buffer[strlen(buffer)-1]='\0';
     387      if (buffer[strlen(buffer) - 1] == '\n')
     388        buffer[strlen(buffer) - 1] = '\0';
    388389      subs[count].zsub_class=owl_strdup("login");
    389390      subs[count].zsub_recipient=owl_strdup("*");
Note: See TracChangeset for help on using the changeset viewer.