Page Menu
Home
Accel-ppp
Search
Configure Global Search
Log In
Files
F4180
telnet_с.patch
shumbor (Boris)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
shumbor
Oct 15 2020, 11:12
2020-10-15 11:12:08 (UTC+2)
Size
733 B
Referenced Files
None
Subscribers
None
telnet_с.patch
View Options
diff --git a/accel-pppd/cli/telnet.c b/accel-pppd/cli/telnet.c
index 33a82e4..69da2d8 100644
--- a/accel-pppd/cli/telnet.c
+++ b/accel-pppd/cli/telnet.c
@@ -732,11 +732,14 @@ static void load_history_file(void)
return;
while (fgets((char *)temp_buf, RECV_BUF_SIZE, f)) {
- b = _malloc(sizeof(*b) + strlen((char *)temp_buf) + 1);
- b->p_buf = NULL;
- b->size = strlen((char *)temp_buf) - 1;
- memcpy(b->buf, temp_buf, b->size);
- list_add_tail(&b->entry, &history);
+ int buf_len=strlen((char *)temp_buf);
+ if( buf_len > 0){
+ b = _malloc(sizeof(*b) + buf_len + 1);
+ b->p_buf = NULL;
+ b->size = buf_len - 1;
+ memcpy(b->buf, temp_buf, b->size);
+ list_add_tail(&b->entry, &history);
+ }
}
fclose(f);
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/td/jm/74z5pg6pf5hih6eg
Default Alt Text
telnet_с.patch (733 B)
Attached To
Mode
T29: Падение в telnet.c когда поврежден (с мусором - нули) history файл
Attached
Detach File
Event Timeline
Log In to Comment