mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
833 B

  1. Index: slp.c
  2. ===================================================================
  3. RCS file: /cvsroot/gaim/gaim/src/protocols/msn/slp.c,v
  4. retrieving revision 1.7
  5. retrieving revision 1.8
  6. diff -u -d -p -r1.7 -r1.8
  7. --- gaim-old/src/protocols/msn/slp.c 15 Jun 2004 02:37:25 -0000 1.7
  8. +++ gaim-new/src/protocols/msn/slp.c 11 Aug 2004 18:05:10 -0000 1.8
  9. @@ -645,8 +645,12 @@ msn_slp_sip_recv(MsnSlpLink *slplink, co
  10. if ((c = strchr(status, '\r')) || (c = strchr(status, '\n')) ||
  11. (c = strchr(status, '\0')))
  12. {
  13. - strncpy(temp, status, c - status);
  14. - temp[c - status] = '\0';
  15. + size_t offset = c - status;
  16. + if (offset >= sizeof(temp))
  17. + offset = sizeof(temp) - 1;
  18. +
  19. + strncpy(temp, status, offset);
  20. + temp[offset] = '\0';
  21. }
  22. gaim_debug_error("msn", "Received non-OK result: %s\n", temp);