Changeset 7961a57


Ignore:
Timestamp:
Jul 27, 2010, 9:10:43 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
release-1.6
Children:
de44b96
Parents:
b19e324
git-author:
Nelson Elhage <nelhage@mit.edu> (07/15/10 23:23:23)
git-committer:
Nelson Elhage <nelhage@mit.edu> (07/27/10 21:10:43)
Message:
zephyr.c: Handle errors from ZPending and ZReceiveNotice.

It is easy for a remote user to cause these functions to return errors by
sending us corrupt zgrams, so basically the only safe thing to do is to ignore
the errors.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    r6758c74 r7961a57  
    179179{
    180180#ifdef HAVE_LIBZEPHYR
    181   if(owl_global_is_havezephyr(&g))
    182     return(ZPending());
     181  Code_t code;
     182  if(owl_global_is_havezephyr(&g)) {
     183    if((code = ZPending()) < 0) {
     184      owl_function_debugmsg("Error (%s) in ZPending()\n",
     185                            error_message(code));
     186      return 0;
     187    }
     188    return code;
     189  }
    183190#endif
    184191  return 0;
     
    13811388#ifdef HAVE_LIBZEPHYR
    13821389  ZNotice_t notice;
     1390  Code_t code;
    13831391  owl_message *m=NULL;
    13841392
    13851393  while(owl_zephyr_zpending() && zpendcount < OWL_MAX_ZEPHYRGRAMS_TO_PROCESS) {
    13861394    if (owl_zephyr_zpending()) {
    1387       ZReceiveNotice(&notice, NULL);
     1395      if ((code = ZReceiveNotice(&notice, NULL)) != ZERR_NONE) {
     1396        owl_function_debugmsg("Error: %s while calling ZReceiveNotice\n",
     1397                              error_message(code));
     1398        continue;
     1399      }
    13881400      zpendcount++;
    13891401
Note: See TracChangeset for help on using the changeset viewer.