- Description:
Security Audit 5:13. Refix for using proper length on strncpy. Maximum Length is 512 characters. - Modified files: c_adlib/GKEngine.cs c_adlib/ad_gk/GnomeKeyring.cs c_adlib/ad_gk/native/ad_gk.c
This commit is contained in:
@@ -50,9 +50,9 @@ namespace Novell.CASA.DataEngines.GK
|
||||
public int cTime;
|
||||
public NativeItemInfo()
|
||||
{
|
||||
/* The GUI allows 256 as the max number of chars for these items */
|
||||
displayName = Marshal.AllocHGlobal(256);
|
||||
secret = Marshal.AllocHGlobal(256);
|
||||
/* The GUI allows 513 as the max number of chars for these items */
|
||||
displayName = Marshal.AllocHGlobal(512 + 1);
|
||||
secret = Marshal.AllocHGlobal(512 + 1);
|
||||
}
|
||||
~NativeItemInfo()
|
||||
{
|
||||
|
||||
@@ -748,9 +748,9 @@ void ItemGetInfoCb( GnomeKeyringResult result,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* maxlen = 255. This should be one less than the size of
|
||||
/* maxlen = 512. This should be one less than the size of
|
||||
Novell.CASA.DataEngines.GK.NativeItemInfo.displayName */
|
||||
maxlen = sizeof (itemInfo->displayName);
|
||||
maxlen = 512;
|
||||
item = gnome_keyring_item_info_get_display_name(info);
|
||||
itemlen = strlen (item);
|
||||
if (itemlen > maxlen) {
|
||||
@@ -760,9 +760,9 @@ void ItemGetInfoCb( GnomeKeyringResult result,
|
||||
itemInfo->displayName[itemlen] = '\0';
|
||||
}
|
||||
|
||||
/* maxlen = 255. This should be one less than the size of
|
||||
/* maxlen = 512. This should be one less than the size of
|
||||
Novell.CASA.DataEngines.GK.NativeItemInfo.secret */
|
||||
maxlen = sizeof (itemInfo->secret);
|
||||
maxlen = 512;
|
||||
item = gnome_keyring_item_info_get_secret(info);
|
||||
itemlen = strlen (item);
|
||||
if (itemlen > maxlen) {
|
||||
|
||||
Reference in New Issue
Block a user