Mercurial > pidgin.yaz
comparison src/util.c @ 1622:1acef460964a
[gaim-migrate @ 1632]
trying to prevent buffer overflows
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Tue, 20 Mar 2001 19:16:17 +0000 |
parents | b4473be6fcc5 |
children | e6671b80a1f2 |
comparison
equal
deleted
inserted
replaced
1621:cf2071b095ca | 1622:1acef460964a |
---|---|
115 } | 115 } |
116 | 116 |
117 gint linkify_text(char *text) | 117 gint linkify_text(char *text) |
118 { | 118 { |
119 char *c, *t; | 119 char *c, *t; |
120 char *cpy = g_malloc(strlen(text) * 2 + 1); | 120 char *cpy = g_malloc(strlen(text) * 3 + 1); |
121 char url_buf[512]; | 121 char url_buf[BUF_LEN * 4]; |
122 int cnt = 0; | 122 int cnt = 0; |
123 /* Assumes you have a buffer able to cary at least BUF_LEN * 2 bytes */ | 123 /* Assumes you have a buffer able to cary at least BUF_LEN * 2 bytes */ |
124 | 124 |
125 strncpy(cpy, text, strlen(text)); | 125 strncpy(cpy, text, strlen(text)); |
126 cpy[strlen(text)] = 0; | 126 cpy[strlen(text)] = 0; |