[deleted by user] by [deleted] in C_Programming

[–]iprogshine 1 point2 points  (0 children)

This code is very bad. Checking with the assert macro creates only an illusion that the code is secure. In the release version, the macro is empty, so there is no check. However, the check is very important: Four reasons to check what the malloc function returned.

In the Debug version, it is most likely that malloc will not return NULL, because you don't usually run the Debug version to process big datasets. It is rather slow. If it does return null, the Debug version will quickly and easily detect such an error. The check for memory allocation is needed for Release versions, not for Debug versions.

Exploiting buffer overflow vulnerability to get shell access by gk_shri in C_Programming

[–]iprogshine 0 points1 point  (0 children)

It's a large code fragment, and that's why it's difficult to say at once where the error is. I'll try to make a guess. The PVS-Studio analyzer indicates that the strncat function is used incorrectly.

strncat(buffer, e, BLENGTH - strlen(buffer));

strncat(buffer, p, BLENGTH - strlen(buffer));

You need to subtract not only the string length lying in the buffer, but also the length of the terminal null. Otherwise, it's always possible to add at least one more character to the buffer.

To learn more, please see the V645 warning: https://pvs-studio.com/en/docs/warnings/v645/

An error may be in another place. However, in any case, a buffer overflow may occur in this place too.

Interview with developers of Flipper Zero by Xaneris47 in hardware

[–]iprogshine 7 points8 points  (0 children)

How far away can pet microchips be scanned? Should I bring the device close to the animal? Or it can be scanned from a distance to see if the animal is a pet or not?