diff options
author | Eric Dong <eric.dong@intel.com> | 2015-03-03 05:07:18 +0000 |
---|---|---|
committer | hwu1225 <hwu1225@Edk2> | 2015-03-03 05:07:18 +0000 |
commit | 401bf9a541aa79dd6c39ecda9376b5972a4b6557 (patch) | |
tree | 45ac592f029b671d569e627e4743947279b32b54 /MdePkg | |
parent | 343b64ccb7dc5c61a2168cc31603569f8866386d (diff) | |
download | edk2-401bf9a541aa79dd6c39ecda9376b5972a4b6557.tar.gz |
MdePkg: Add deprecate flag for the functions which has a replace function in safe c library.
(Sync patch r16521 from main trunk.)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2014.SP1@16990 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r-- | MdePkg/Include/Library/BaseLib.h | 31 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/String.c | 26 |
2 files changed, 54 insertions, 3 deletions
diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h index d65b01adf6..bd3f9cfc60 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -481,7 +481,11 @@ AsciiStrnCatS ( );
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Copies one Null-terminated Unicode string to another Null-terminated Unicode
string and returns the new Unicode string.
@@ -513,6 +517,8 @@ StrCpy ( /**
+ [ATTENTION] This function will be deprecated for security reason.
+
Copies up to a specified length from one Null-terminated Unicode string to
another Null-terminated Unicode string and returns the new Unicode string.
@@ -549,7 +555,7 @@ StrnCpy ( IN CONST CHAR16 *Source,
IN UINTN Length
);
-
+#endif
/**
Returns the length of a Null-terminated Unicode string.
@@ -677,7 +683,11 @@ StrnCmp ( );
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Concatenates one Null-terminated Unicode string to another Null-terminated
Unicode string, and returns the concatenated Unicode string.
@@ -718,6 +728,8 @@ StrCat ( /**
+ [ATTENTION] This function will be deprecated for security reason.
+
Concatenates up to a specified length one Null-terminated Unicode to the end
of another Null-terminated Unicode string, and returns the concatenated
Unicode string.
@@ -762,6 +774,7 @@ StrnCat ( IN CONST CHAR16 *Source,
IN UINTN Length
);
+#endif
/**
Returns the first occurrence of a Null-terminated Unicode sub-string
@@ -1000,7 +1013,11 @@ UnicodeStrToAsciiStr ( );
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Copies one Null-terminated ASCII string to another Null-terminated ASCII
string and returns the new ASCII string.
@@ -1030,6 +1047,8 @@ AsciiStrCpy ( /**
+ [ATTENTION] This function will be deprecated for security reason.
+
Copies up to a specified length one Null-terminated ASCII string to another
Null-terminated ASCII string and returns the new ASCII string.
@@ -1063,7 +1082,7 @@ AsciiStrnCpy ( IN CONST CHAR8 *Source,
IN UINTN Length
);
-
+#endif
/**
Returns the length of a Null-terminated ASCII string.
@@ -1223,7 +1242,11 @@ AsciiStrnCmp ( );
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Concatenates one Null-terminated ASCII string to another Null-terminated
ASCII string, and returns the concatenated ASCII string.
@@ -1259,6 +1282,8 @@ AsciiStrCat ( /**
+ [ATTENTION] This function will be deprecated for security reason.
+
Concatenates up to a specified length one Null-terminated ASCII string to
the end of another Null-terminated ASCII string, and returns the
concatenated ASCII string.
@@ -1301,7 +1326,7 @@ AsciiStrnCat ( IN CONST CHAR8 *Source,
IN UINTN Length
);
-
+#endif
/**
Returns the first occurrence of a Null-terminated ASCII sub-string
diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c index 9505c5b21e..92992a5d27 100644 --- a/MdePkg/Library/BaseLib/String.c +++ b/MdePkg/Library/BaseLib/String.c @@ -14,8 +14,11 @@ #include "BaseLibInternals.h"
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Copies one Null-terminated Unicode string to another Null-terminated Unicode
string and returns the new Unicode string.
@@ -68,6 +71,8 @@ StrCpy ( }
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Copies up to a specified length from one Null-terminated Unicode string to
another Null-terminated Unicode string and returns the new Unicode string.
@@ -137,6 +142,7 @@ StrnCpy ( ZeroMem (Destination, Length * sizeof (*Destination));
return ReturnValue;
}
+#endif
/**
Returns the length of a Null-terminated Unicode string.
@@ -319,7 +325,11 @@ StrnCmp ( return *FirstString - *SecondString;
}
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Concatenates one Null-terminated Unicode string to another Null-terminated
Unicode string, and returns the concatenated Unicode string.
@@ -369,6 +379,8 @@ StrCat ( }
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Concatenates up to a specified length one Null-terminated Unicode to the end
of another Null-terminated Unicode string, and returns the concatenated
Unicode string.
@@ -427,6 +439,7 @@ StrnCat ( ASSERT (StrSize (Destination) != 0);
return Destination;
}
+#endif
/**
Returns the first occurrence of a Null-terminated Unicode sub-string
@@ -1065,8 +1078,11 @@ UnicodeStrToAsciiStr ( return ReturnValue;
}
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Copies one Null-terminated ASCII string to another Null-terminated ASCII
string and returns the new ASCII string.
@@ -1116,6 +1132,8 @@ AsciiStrCpy ( }
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Copies up to a specified length one Null-terminated ASCII string to another
Null-terminated ASCII string and returns the new ASCII string.
@@ -1181,6 +1199,7 @@ AsciiStrnCpy ( ZeroMem (Destination, Length * sizeof (*Destination));
return ReturnValue;
}
+#endif
/**
Returns the length of a Null-terminated ASCII string.
@@ -1462,7 +1481,11 @@ AsciiStrnCmp ( return *FirstString - *SecondString;
}
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
+
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Concatenates one Null-terminated ASCII string to another Null-terminated
ASCII string, and returns the concatenated ASCII string.
@@ -1507,6 +1530,8 @@ AsciiStrCat ( }
/**
+ [ATTENTION] This function will be deprecated for security reason.
+
Concatenates up to a specified length one Null-terminated ASCII string to
the end of another Null-terminated ASCII string, and returns the
concatenated ASCII string.
@@ -1563,6 +1588,7 @@ AsciiStrnCat ( ASSERT (AsciiStrSize (Destination) != 0);
return Destination;
}
+#endif
/**
Returns the first occurrence of a Null-terminated ASCII sub-string
|