summaryrefslogtreecommitdiff
path: root/secbuf.h
diff options
context:
space:
mode:
authorbeatrice <beatrice@dangofactory.net>2026-11-22 19:25:05 +0900
committerbeatrice <beatrice@dangofactory.net>2026-11-22 19:25:05 +0900
commitc7a201b58080c7a0f57b38c59e7865aa42c1d029 (patch)
treecde6146e3aada31e68594fd4f034abe90621ce34 /secbuf.h
downloadvsftpd-master.tar.gz
vsftpd-master.zip
Import vsftpd-3.0.5.tar.gzHEADlocal/vsftpdmaster
Diffstat (limited to 'secbuf.h')
-rw-r--r--secbuf.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/secbuf.h b/secbuf.h
new file mode 100644
index 0000000..b59ebf9
--- /dev/null
+++ b/secbuf.h
@@ -0,0 +1,27 @@
+#ifndef VSF_SECBUF_H
+#define VSF_SECBUF_H
+
+/* vsf_secbuf_alloc()
+ * PURPOSE
+ * Allocate a "secure buffer". A secure buffer is one which will attempt to
+ * catch out of bounds accesses by crashing the program (rather than
+ * corrupting memory). It works by using UNIX memory protection. It isn't
+ * foolproof.
+ * PARAMETERS
+ * p_ptr - pointer to a pointer which is to contain the secure buffer.
+ * Any previous buffer pointed to is freed.
+ * size - size in bytes required for the secure buffer.
+ */
+void vsf_secbuf_alloc(char** p_ptr, unsigned int size);
+
+/* vsf_secbuf_free()
+ * PURPOSE
+ * Frees a "secure buffer".
+ * PARAMETERS
+ * p_ptr - pointer to a pointer containing the buffer to be freed. The
+ * buffer pointer is nullified by this call.
+ */
+void vsf_secbuf_free(char** p_ptr);
+
+#endif /* VSF_SECBUF_H */
+