Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
daniel:// stenberg://
daniel:// stenberg://
@bagder@mastodon.social  ·  activity timestamp 8 hours ago

strcpy density in #curl source code

a graph showing the strcpy density in the curl source code, going from above 2 per KLOC in the early 2000s to zero in the end of 2025
a graph showing the strcpy density in the curl source code, going from above 2 per KLOC in the early 2000s to zero in the end of 2025
a graph showing the strcpy density in the curl source code, going from above 2 per KLOC in the early 2000s to zero in the end of 2025
  • Copy link
  • Flag this post
  • Block
EricJ
EricJ
@ericj@social.accum.se replied  ·  activity timestamp 6 hours ago

@bagder Interesting to see that the graph is not strictly decreasing — meaning that there were commits that added new strcpy() lines as late as this year, despite the projects' review efforts. 🤔

Nonetheless, congrats on reaching 0%. Is there a plan to prevent calls to "bad" functions from sneaking back in again?

  • Copy link
  • Flag this comment
  • Block
Kevin Beaumont
Kevin Beaumont
@GossiTheDog@cyberplace.social replied  ·  activity timestamp 7 hours ago

@bagder great work. Coulda just rewrote the entire of curl in Rust tho 🥴

  • Copy link
  • Flag this comment
  • Block
Oliver Schönrock
Oliver Schönrock
@oschonrock@mastodon.social replied  ·  activity timestamp 7 hours ago

@bagder

Great stuff. What was the motivation here?

performance (ie copying per se), or security (ie replace with strncopy)

  • Copy link
  • Flag this comment
  • Block
daniel:// stenberg://
daniel:// stenberg://
@bagder@mastodon.social replied  ·  activity timestamp 7 hours ago

@oschonrock to reduce the risk of mistakes, so security pretty much

  • Copy link
  • Flag this comment
  • Block
mth
mth
@mmth@mastodon.social replied  ·  activity timestamp 6 hours ago

@bagder @oschonrock - looking at the code, this seems to be a hardened version of the original function? Is there a case to include the in the original lib? (Maybe as a new function if there could be backwards compatibility issues)

  • Copy link
  • Flag this comment
  • Block
Kevin
Kevin
@kevinevans@hachyderm.io replied  ·  activity timestamp 7 hours ago

@bagder is it being replaced with strncpy or similar?

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-alpha.40 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct