Unsafe use of strncpy replaced by strlcpy. CID 2237.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40633 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström
2011-02-23 01:54:33 +00:00
parent 585db48d51
commit 08a750214c
+6 -6
View File
@@ -568,8 +568,8 @@ VideoWindow::MessageReceived(BMessage* message)
switch (message->what) { switch (message->what) {
case msg_filename: case msg_filename:
if (control != NULL) { if (control != NULL) {
strncpy(fFtpInfo.fileNameText, strlcpy(fFtpInfo.fileNameText,
((BTextControl*)control)->Text(), 63); ((BTextControl*)control)->Text(), 64);
FTPINFO("file is '%s'\n", fFtpInfo.fileNameText); FTPINFO("file is '%s'\n", fFtpInfo.fileNameText);
} }
break; break;
@@ -600,7 +600,7 @@ VideoWindow::MessageReceived(BMessage* message)
case msg_server: case msg_server:
if (control != NULL) { if (control != NULL) {
strncpy(fFtpInfo.serverText, strlcpy(fFtpInfo.serverText,
((BTextControl*)control)->Text(), 64); ((BTextControl*)control)->Text(), 64);
FTPINFO("server = '%s'\n", fFtpInfo.serverText); FTPINFO("server = '%s'\n", fFtpInfo.serverText);
} }
@@ -608,7 +608,7 @@ VideoWindow::MessageReceived(BMessage* message)
case msg_login: case msg_login:
if (control != NULL) { if (control != NULL) {
strncpy(fFtpInfo.loginText, strlcpy(fFtpInfo.loginText,
((BTextControl*)control)->Text(), 64); ((BTextControl*)control)->Text(), 64);
FTPINFO("login = '%s'\n", fFtpInfo.loginText); FTPINFO("login = '%s'\n", fFtpInfo.loginText);
} }
@@ -616,7 +616,7 @@ VideoWindow::MessageReceived(BMessage* message)
case msg_password: case msg_password:
if (control != NULL) { if (control != NULL) {
strncpy(fFtpInfo.passwordText, strlcpy(fFtpInfo.passwordText,
((BTextControl*)control)->Text(), 64); ((BTextControl*)control)->Text(), 64);
FTPINFO("password = '%s'\n", fFtpInfo.passwordText); FTPINFO("password = '%s'\n", fFtpInfo.passwordText);
} }
@@ -624,7 +624,7 @@ VideoWindow::MessageReceived(BMessage* message)
case msg_directory: case msg_directory:
if (control != NULL) { if (control != NULL) {
strncpy(fFtpInfo.directoryText, strlcpy(fFtpInfo.directoryText,
((BTextControl*)control)->Text(), 64); ((BTextControl*)control)->Text(), 64);
FTPINFO("directory = '%s'\n", fFtpInfo.directoryText); FTPINFO("directory = '%s'\n", fFtpInfo.directoryText);
} }