buffer-overrun

c6386 buffer overrun while writing

回眸只為那壹抹淺笑 提交于 2021-01-29 16:20:28
问题 Function Name: expandStack Input: a pointer to a Stack type (Stack*) Output: none Function Operation: The function expands a stack void expandStack(Stack* stack){ //Check the stack and the array are allocated if (stack == NULL ||stack->content == NULL) { return; } //Allocating a new sized array (*2 from the previous) Element* expandedStack = (Element*)malloc(2 * (stack->size) * sizeof(Element)); //Case malloc failed if (expandedStack == NULL) { printf("Error! Malloc has failed in file 'stack

Does Java have buffer overflows?

安稳与你 提交于 2019-12-27 13:59:14
问题 Does Java have buffer overflows? If yes can you give me scenarios? 回答1: Since Java Strings are based on char arrays and Java automatically checks array bounds, buffer overflows are only possible in unusual scenarios: If you call native code via JNI In the JVM itself (usually written in C++) The interpreter or JIT compiler does not work correctly (Java bytecode mandated bounds checks) 回答2: Managed languages such as Java and C# do not have these problems, but the specific virtual machines (JVM

Stack cookie instrumentation code detected a stack-based buffer overrun - Fixed

元气小坏坏 提交于 2019-12-23 12:26:09
问题 so I am having a few issues with this program used to pixelate an image. One issue is that I get a "Stack around the variable 'pixArray' was corrupted" and then, when I click continue after breaking it gives the error in the title. I'm not sure if it is acceptable to use pastebin, but I'll use it for the sake of having a "short" post. The Code The Image Being Used Also, when it runs through, all of the pixelated squares are one pixel too short on the left and top of the squares. It is just

What is the difference between STATUS_STACK_BUFFER_OVERRUN and STATUS_STACK_OVERFLOW?

筅森魡賤 提交于 2019-12-21 12:12:32
问题 I just found out that there is a STATUS_STACK_BUFFER_OVERRUN and a STATUS_STACK_OVERFLOW. What's the difference between those 2? I just found Stack overflow (stack exhaustion) not the same as stack buffer overflow but either it doesn't explain it or I don't understand it. Can you help me out? Regards Tobias 回答1: Consider the following stack which grows downward in memory: +----------------+ | some data | | +----------------+ | growth of stack | 20-byte string | V +----------------+ limit of

Is buffer overflow/overrun possible in completely managed asp.net c# web application

北战南征 提交于 2019-12-21 07:28:44
问题 Can there be buffer overflow/overrun vulnerabilities in completely managed asp.net web portal.If yes how can this be tested. 回答1: Not unless you exploit the webserver or .NET/ASP.NET stack itself. 回答2: In the general case, you don't need to worry about buffer overruns. This is one of the major advantages of managed code, garbage collection being perhaps the other major advantage. There are a few edge cases that you should be aware of - any time your managed code interacts with unmanaged code

if one complains about gets(), why not do the same with scanf(“%s”,…)?

▼魔方 西西 提交于 2019-12-19 03:14:17
问题 From man gets : Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and because gets() will continue to store characters past the end of the buffer, it is extremely dangerous to use. It has been used to break computer security. Use fgets() instead. Almost everywhere I see scanf being used in a way that should have the same problem (buffer overflow/buffer overrun): scanf("%s",string) . This problem exists in this case?

How do you program safely outside of a managed code environment?

蓝咒 提交于 2019-12-18 13:17:47
问题 If you are someone who programs in C or C++, without the managed-language benefits of memory management, type checking or buffer overrun protection, using pointer arithmetic, how do you make sure that your programs are safe? Do you use a lot of unit tests, or are you just a cautious coder? Do you have other methods? 回答1: All of the above. I use: A lot of caution Smart Pointers as much as possible Data structures which have been tested, a lot of standard library Unit tests all the time Memory

Buffer overrun during Garbage Collection: psychic debugging request

☆樱花仙子☆ 提交于 2019-12-06 08:46:03
问题 Currently testing a C# (.Net 4.5) WPF application built on top of a C++ library (managed, I believe, I didn't write it). For various (practical) reasons, it's running on a server (with VS2012 installed, yes, yuck). The program hooks up to a camera (via the library) and displays the image frames that it receives. What's weird is that I'm getting buffer overruns (buffer overflows I could understand). And during Garbage Collection! A buffer overrun has occurred in App.exe which has corrupted the

Buffer overrun during Garbage Collection: psychic debugging request

这一生的挚爱 提交于 2019-12-04 13:53:12
Currently testing a C# (.Net 4.5) WPF application built on top of a C++ library (managed, I believe, I didn't write it). For various (practical) reasons, it's running on a server (with VS2012 installed, yes, yuck). The program hooks up to a camera (via the library) and displays the image frames that it receives. What's weird is that I'm getting buffer overruns (buffer overflows I could understand). And during Garbage Collection! A buffer overrun has occurred in App.exe which has corrupted the program's internal state. Various other potentially useful tidbits of information: Upping the

Buffer overflow protection for stackalloc in .Net

血红的双手。 提交于 2019-12-04 12:11:55
问题 From C# reference for stackalloc: the use of stackalloc automatically enables buffer overrun detection features in the common language runtime (CLR). If a buffer overrun is detected, the process is terminated as quickly as possible to minimize the chance that malicious code is executed. Specifically, what kind of protection mechanism is implemented for .NET? And will it also detect buffer underruns? Against which known attacks is the protection weaker? For a context, for example for MS C++