Back to list
mgreenly

securitysecure-c

by mgreenly

An AI Coding Agent

1🍴 0📅 Jan 24, 2026

SKILL.md


name: security/secure-c description: Secure C Coding security skill

Secure C Coding

Avoid dangerous functions, use safe alternatives, enable compiler hardening.

Banned Functions → Safe Alternatives

BannedWhyUse Instead
strcpyNo boundsstrncpy, strlcpy, snprintf
strcatNo boundsstrncat, strlcat
sprintfNo boundssnprintf
getsAlways unsafefgets
scanf("%s")No boundsscanf("%Ns") with width
mktempRace conditionmkstemp
atoiNo error detectionstrtol with validation

Compiler Hardening

CFLAGS += -fstack-protector-strong  # Stack canaries
CFLAGS += -D_FORTIFY_SOURCE=2       # Runtime buffer checks
CFLAGS += -fPIE -pie                # ASLR for executables
LDFLAGS += -Wl,-z,relro,-z,now      # GOT protection

Static Analysis

  • make lint - clang-tidy checks
  • cppcheck --enable=all
  • Compiler warnings: -Wall -Wextra -Werror

Review red flags: Any banned function, missing bounds on string ops, char buf[N] with unchecked input.

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon