strnrchr.c \
tempnam.h \
types.h \
- unsafe.h \
valgrind.h \
xalloc.cc \
xalloc.h \
*/
#include "compat/GnuRegex.h"
-/* some functions are unsafe to be used in Squid. */
-#include "compat/unsafe.h"
-
/* cppunit is not quite C++0x compatible yet */
#include "compat/cppunit.h"
+++ /dev/null
-#ifndef _SQUID_COMPAT_UNSAFE_H
-#define _SQUID_COMPAT_UNSAFE_H
-
-/*
- * Trap unintentional use of functions unsafe for use within squid.
- */
-
-#if !SQUID_NO_STRING_BUFFER_PROTECT
-#ifndef sprintf
-#define sprintf ERROR_sprintf_UNSAFE_IN_SQUID
-#endif
-#ifndef strdup
-#define strdup ERROR_strdup_UNSAFE_IN_SQUID
-#endif
-#endif /* SQUID_NO_STRING_BUFFER_PROTECT */
-
-#endif /* _SQUID_COMPAT_UNSAFE_H */
echo "ERROR: ${PWD}/${FILENAME} contains reference to forward.h without path"
fi
+ #
+ # detect functions unsafe for use within Squid.
+ # strdup()
+ #
+ STRDUP=`grep -e "[^x]strdup" ${FILENAME}`;
+ if test "x${STRDUP}" != "x" ; then
+ echo "ERROR: ${PWD}/${FILENAME} contains unprotected use of strdup()"
+ fi
+ SPRINTF=`grep -e "[^v]sprintf" ${FILENAME}`;
+ if test "x${SPRINTF}" != "x" ; then
+ echo "ERROR: ${PWD}/${FILENAME} contains unsafe use of sprintf()"
+ fi
+
#
# DEBUG Section list maintenance
#
if (strcmp(al, Ssl::CertAdaptAlgorithmStr[Ssl::algSetValidAfter]) == 0) {
ca->alg = Ssl::algSetValidAfter;
- ca->param = strdup("on");
+ ca->param = xstrdup("on");
} else if (strcmp(al, Ssl::CertAdaptAlgorithmStr[Ssl::algSetValidBefore]) == 0) {
ca->alg = Ssl::algSetValidBefore;
- ca->param = strdup("on");
+ ca->param = xstrdup("on");
} else if (strcmp(al, Ssl::CertAdaptAlgorithmStr[Ssl::algSetCommonName]) == 0) {
ca->alg = Ssl::algSetCommonName;
if (param) {
self_destruct();
return;
}
- ca->param = strdup(param);
+ ca->param = xstrdup(param);
}
} else {
debugs(3, DBG_CRITICAL, "FATAL: sslproxy_cert_adapt: unknown cert adaptation algorithm: " << al);