Is it secure to use malloc?

前端 未结 12 844
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-05 04:18

Somebody told me that allocating with malloc is not secure anymore, I\'m not a C/C++ guru but I\'ve made some stuff with malloc and C/C++. Does anyone know about what risks

12条回答
  •  一向
    一向 (楼主)
    2021-01-05 04:53

    In C++, there is no such problem if you stick to good conventions. In C, well, practice. Malloc itself is not an inherently insecure function at all - people simply can deal with it's results inadequately.

提交回复
热议问题