Sha256: 9b79bc3e00d4468b7d2301cf21b636819e2a7e4162ade46df40050a52e2a5528

Contents?: true

Size: 795 Bytes

Versions: 8

Compression:

Stored size: 795 Bytes

Contents

#ifndef BANNED_H
#define BANNED_H

/*
 * This header lists functions that have been banned from our code base,
 * because they're too easy to misuse (and even if used correctly,
 * complicate audits). Including this header turns them into compile-time
 * errors.
 */

#define BANNED(func) sorry_##func##_is_a_banned_function

#undef strcpy
#define strcpy(x,y) BANNED(strcpy)
#undef strcat
#define strcat(x,y) BANNED(strcat)
#undef strncpy
#define strncpy(x,y,n) BANNED(strncpy)
#undef strncat
#define strncat(x,y,n) BANNED(strncat)

#undef sprintf
#undef vsprintf
#ifdef HAVE_VARIADIC_MACROS
#define sprintf(...) BANNED(sprintf)
#define vsprintf(...) BANNED(vsprintf)
#else
#define sprintf(buf,fmt,arg) BANNED(sprintf)
#define vsprintf(buf,fmt,arg) BANNED(sprintf)
#endif

#endif /* BANNED_H */

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
curb-1.0.6 ext/banned.h
curb-1.0.5 ext/banned.h
curb-1.0.4 ext/banned.h
curb-1.0.3 ext/banned.h
curb-1.0.2 ext/banned.h
curb-1.0.1 ext/banned.h
curb-1.0.0 ext/banned.h
curb-0.9.11 ext/banned.h