Changeset 6201646 for zephyr.c


Ignore:
Timestamp:
Dec 28, 2007, 5:21:57 PM (13 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
7b1d048
Parents:
5376a95
Message:
Fixing bug encountered when last field was not null-terminated.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    r5376a95 r6201646  
    369369      if (count == j) {
    370370        /* just found the end of the field we're looking for */
    371         return(owl_validate_or_convert(n->z_message + save, -1));
     371        return(owl_validate_or_convert(n->z_message + save));
    372372      } else {
    373373        save = i + 1;
     
    377377  /* catch the last field, which might not be null terminated */
    378378  if (count == j - 1) {
    379     return owl_validate_or_convert(n->z_message + save, n->z_message_len - save);
     379    char *tmp, *out;
     380    tmp = owl_malloc(n->z_message_len-save+5);
     381    memcpy(tmp, n->z_message+save, n->z_message_len-save);
     382    tmp[n->z_message_len-save]='\0';
     383    out = owl_validate_or_convert(tmp);
     384    owl_free(tmp);
     385    return out;
    380386  }
    381387
Note: See TracChangeset for help on using the changeset viewer.