aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/avstring.h
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-09-09 21:00:51 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-09-09 21:00:51 +0000
commit46f3b40eb3bcb377054804631844923de9a9b45f (patch)
tree611c3daecfff426292b977ff1ff09a80b7f6ea0d /libavutil/avstring.h
parent76bcd87b4cd679b2d26b4b9ddddd4dc6451cab54 (diff)
downloadffmpeg-46f3b40eb3bcb377054804631844923de9a9b45f.tar.gz
Add warnings to av_strlcat and av_strlcpy doxygen that the input strings
already must be properly 0-terminated strings. Unlike strncpy it cannot be used on raw data read from a file. Originally committed as revision 19800 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/avstring.h')
-rw-r--r--libavutil/avstring.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index 97c2f38715..d716c3a282 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -56,6 +56,10 @@ int av_stristart(const char *str, const char *pfx, const char **ptr);
* @param src source string
* @param size size of destination buffer
* @return the length of src
+ *
+ * WARNING: since the return value is the length of src, src absolutely
+ * _must_ be a properly 0-terminated string, otherwise this will read beyond
+ * the end of the buffer and possibly crash.
*/
size_t av_strlcpy(char *dst, const char *src, size_t size);
@@ -70,6 +74,10 @@ size_t av_strlcpy(char *dst, const char *src, size_t size);
* @param src source string
* @param size size of destination buffer
* @return the total length of src and dst
+ *
+ * WARNING: since the return value use the length of src and dst, these absolutely
+ * _must_ be a properly 0-terminated strings, otherwise this will read beyond
+ * the end of the buffer and possibly crash.
*/
size_t av_strlcat(char *dst, const char *src, size_t size);