The code and data behind xeiaso.net
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

cmd/no-way-to-prevent-this: C++

Also golf the code a bit so that it fits into _exactly_ 69 lines of Go.
Fitting into 69 lines of Go is critical for this program.

Signed-off-by: Xe Iaso <me@xeiaso.net>

Xe Iaso 687cb645 cc378f9b

+5 -5
+5 -5
cmd/no-way-to-prevent-this/main.go
··· 11 11 12 12 var ( 13 13 date = flag.String("date", time.Now().Format(time.DateOnly), "Date of the CVE") 14 + cPlusPlus = flag.Bool("c++", false, "If true, the project is written in C++") 14 15 cve = flag.String("cve", "", "CVE number") 15 16 cveLink = flag.String("cve-link", "", "CVE link") 16 17 project = flag.String("project", "", "Project name") ··· 28 29 } 29 30 defer fout.Close() 30 31 31 - name := faker.Name() 32 - 33 - data := map[string]string{ 32 + data := map[string]any{ 34 33 "Date": *date, 35 34 "CVE": *cve, 36 35 "CVELink": *cveLink, 37 36 "Project": *project, 38 37 "ProjectLink": *projectLink, 39 38 "Summary": *summary, 40 - "Name": name, 39 + "Name": faker.Name(), 40 + "CPlusPlus": *cPlusPlus, 41 41 } 42 42 43 43 tmpl := template.Must(template.New("article").Parse(articleTemplate)) ··· 59 59 60 60 In the hours following the release of [{{.CVE}}]({{.CVELink}}) for the project [{{.Project}}]({{.ProjectLink}}), site reliability workers 61 61 and systems administrators scrambled to desperately rebuild and patch all their systems to fix {{.Summary}}. This is due to the affected components being 62 - written in C, the only programming language where these vulnerabilities regularly happen. "This was a terrible tragedy, but sometimes 62 + written in C{{if .CPlusPlus}}++{{end}}, the only programming language where these vulnerabilities regularly happen. "This was a terrible tragedy, but sometimes 63 63 these things just happen and there's nothing anyone can do to stop them," said programmer {{.Name}}, echoing statements 64 64 expressed by hundreds of thousands of programmers who use the only language where 90% of the world's memory safety vulnerabilities have 65 65 occurred in the last 50 years, and whose projects are 20 times more likely to have security vulnerabilities. "It's a shame, but what can