Changeset 8ab1f28


Ignore:
Timestamp:
Jul 16, 2010, 7:43:41 PM (11 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
0552482
Parents:
95414bf
git-author:
Nelson Elhage <nelhage@mit.edu> (07/15/10 23:23:23)
git-committer:
Nelson Elhage <nelhage@mit.edu> (07/16/10 19:43:41)
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

    r3687413 r8ab1f28  
    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;
     
    13881395#ifdef HAVE_LIBZEPHYR
    13891396  ZNotice_t notice;
     1397  Code_t code;
    13901398  owl_message *m=NULL;
    13911399
    13921400  while(owl_zephyr_zpending() && zpendcount < OWL_MAX_ZEPHYRGRAMS_TO_PROCESS) {
    13931401    if (owl_zephyr_zpending()) {
    1394       ZReceiveNotice(&notice, NULL);
     1402      if ((code = ZReceiveNotice(&notice, NULL)) != ZERR_NONE) {
     1403        owl_function_debugmsg("Error: %s while calling ZReceiveNotice\n",
     1404                              error_message(code));
     1405        continue;
     1406      }
    13951407      zpendcount++;
    13961408
Note: See TracChangeset for help on using the changeset viewer.