patch-test_dnet_aton_c 504 B

123456789101112131415
  1. $OpenBSD: patch-test_dnet_aton_c,v 1.1 2011/09/18 08:32:56 bluhm Exp $
  2. http://code.google.com/p/libdnet/issues/detail?id=17
  3. --- test/dnet/aton.c.orig Mon Oct 14 17:42:10 2002
  4. +++ test/dnet/aton.c Thu Jan 20 03:26:57 2011
  5. @@ -86,7 +86,7 @@ off_aton(char *string, uint16_t *off)
  6. } else {
  7. i = strtol(string, &p, 10);
  8. if (*string == '\0' || (*p != '\0' && *p != '+') ||
  9. - i > IP_OFFMASK)
  10. + i > (IP_OFFMASK << 3))
  11. return (-1);
  12. *off = htons(((*p == '+') ? IP_MF : 0) | (i >> 3));
  13. }