You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
these code confused me.
memcpy(destination + USERNAME_OFFSET, &(source->username), USERNAME_SIZE);
when the input is "insert 1 csstack foo@bar.com " the length of Row.username is 7, but the args for memcpy copy size is USERNAME_SIZE, which is 32. Is there is some problem? The size of the given username(csstack) is smaller than the USER_SIZE. This may be copy some bytes that doesn't need. Same problem for the EMAIL_SIZE. I was blocked by these code. Could you help me? Thanks a lot.
The text was updated successfully, but these errors were encountered:
You're right. This code copies the entire buffer rather than the length of the string. I wasn't focusing on performance to start, and I thought this was simpler.
We know that the clang stirng was terminated by '\0'. Copy the entire buffer in the deserialize_row method. char username[USERNAME_SIZE] in Row is csstack, username[7] was not set '\0' explicitly. If the value of username[7] is not '\0', when execute 'select', this may be wrong.
these code confused me.
memcpy(destination + USERNAME_OFFSET, &(source->username), USERNAME_SIZE);
when the input is "insert 1 csstack foo@bar.com " the length of Row.username is 7, but the args for memcpy copy size is USERNAME_SIZE, which is 32. Is there is some problem? The size of the given username(csstack) is smaller than the USER_SIZE. This may be copy some bytes that doesn't need. Same problem for the EMAIL_SIZE. I was blocked by these code. Could you help me? Thanks a lot.
The text was updated successfully, but these errors were encountered: