[quagga-dev 5282] Re: mes_lookup / LOOKUP robustness

Andrew J. Schorr aschorr at telemetry-investments.com
Thu Feb 28 23:39:19 GMT 2008


Hi,

I hate to beat a dead horse, but do we now have to review the
other message lookup function?

const char *
lookup (struct message *mes, int key)
{
  struct message *pnt;

  for (pnt = mes; pnt->key != 0; pnt++) 
    if (pnt->key == key) 
      return pnt->str;

  return "";
}

So this one returns "" if it doesn't find the message.
And it does not check whether 'pnt->str' might be NULL.

Does this matter?

Regards,
Andy



More information about the Quagga-dev mailing list