# HG changeset patch # User Mark Doliner # Date 1093195897 0 # Node ID 54377b120d199ec8659b542f7f21ba352d674041 # Parent 524cd6d1496e625ec60be8abddc30add4a20fd72 [gaim-migrate @ 10694] This is supposed to fix an MSN thing. I think it's from SUSE. If this is wrong, then someone that knows something about MSN should probably do something about it. committer: Tailor Script diff -r 524cd6d1496e -r 54377b120d19 src/protocols/msn/object.c --- a/src/protocols/msn/object.c Sun Aug 22 17:25:59 2004 +0000 +++ b/src/protocols/msn/object.c Sun Aug 22 17:31:37 2004 +0000 @@ -35,11 +35,18 @@ if ((tag = strstr(str, id "=\"")) != NULL) \ { \ char buf[16]; \ + size_t offset; \ tag += strlen(id "=\""); \ c = strchr(tag, '"'); \ - strncpy(buf, tag, c - tag); \ - buf[c - tag] = '\0'; \ - obj->field = atoi(buf); \ + if (c != NULL) \ + { \ + memset(buf, 0, sizeof(buf)); \ + offset = c - tag; \ + if (offset >= sizeof(buf)) \ + offset = sizeof(buf) - 1; \ + strncpy(buf, tag, offset); \ + obj->field = atoi(buf); \ + } \ } static GList *local_objs;