J
John Williams
I've written a simple program to do XOR encryption as my first foray
into understanding how encryption works. The code compiles fine, however
it segmentation faults on every run. using gdb to debug it let me
narrow the problem down to the Cipher function I think it faults at line
84 or 85. The program makes it's first read/cipher/write pass without
issue but the second pass kills it. Using gdb to print the variables
left showed me the following right before the seg fault.
i == 1
j == 1
*buffer[0] contains ciphered text from the previous pass
*buffer[1] "Cannot access memory at address ..."
*buffer[2] random values (uninitialized...however the memory is able to
be accessed)
I can't figure out why *buffer[1] would be inaccessible with my code and
would appreciate some help figuring out my error.
into understanding how encryption works. The code compiles fine, however
it segmentation faults on every run. using gdb to debug it let me
narrow the problem down to the Cipher function I think it faults at line
84 or 85. The program makes it's first read/cipher/write pass without
issue but the second pass kills it. Using gdb to print the variables
left showed me the following right before the seg fault.
i == 1
j == 1
*buffer[0] contains ciphered text from the previous pass
*buffer[1] "Cannot access memory at address ..."
*buffer[2] random values (uninitialized...however the memory is able to
be accessed)
I can't figure out why *buffer[1] would be inaccessible with my code and
would appreciate some help figuring out my error.