comparison src/protocols/jabber/jabber.c @ 3234:6a96436a542a

[gaim-migrate @ 3251] Whacked buffer overflow bug in gjab_recv(). Thanks to rwscott. committer: Tailor Script <tailor@pidgin.im>
author Jim Seymour <jseymour>
date Wed, 08 May 2002 00:50:22 +0000
parents 20612da83d8c
children 6796fdeed022
comparison
equal deleted inserted replaced
3233:96e215745dc0 3234:6a96436a542a
399 int len; 399 int len;
400 400
401 if (!gjc || gjc->state == JCONN_STATE_OFF) 401 if (!gjc || gjc->state == JCONN_STATE_OFF)
402 return; 402 return;
403 403
404 if ((len = read(gjc->fd, buf, sizeof(buf))) > 0) { 404 if ((len = read(gjc->fd, buf, sizeof(buf) - 1)) > 0) {
405 struct jabber_data *jd = GJ_GC(gjc)->proto_data; 405 struct jabber_data *jd = GJ_GC(gjc)->proto_data;
406 buf[len] = '\0'; 406 buf[len] = '\0';
407 debug_printf("input (len %d): %s\n", len, buf); 407 debug_printf("input (len %d): %s\n", len, buf);
408 XML_Parse(gjc->parser, buf, len, 0); 408 XML_Parse(gjc->parser, buf, len, 0);
409 if (jd->die) 409 if (jd->die)