summaryrefslogtreecommitdiff
path: root/src/char/pincode.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2015-01-17 18:49:03 -0200
committershennetsind <ind@henn.et>2015-01-17 18:49:03 -0200
commit3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a (patch)
tree2f646d420976e459ef585debfca2ae55d3185528 /src/char/pincode.c
parent348044f12d5f683c8945e0eac642f2795050fb4e (diff)
downloadhercules-3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a.tar.gz
hercules-3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a.tar.bz2
hercules-3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a.tar.xz
hercules-3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a.zip
Another ~10 Fixes
Addressing out of bounds read/write. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/char/pincode.c')
-rw-r--r--src/char/pincode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/char/pincode.c b/src/char/pincode.c
index e0ee9557d..02c71b3b6 100644
--- a/src/char/pincode.c
+++ b/src/char/pincode.c
@@ -78,7 +78,7 @@ void pincode_change(int fd, struct char_session_data* sd) {
safestrncpy(newpin, (char*)RFIFOP(fd,10), sizeof(newpin));
pincode->decrypt(sd->pincode_seed,newpin);
pincode->update( sd->account_id, newpin );
- strncpy(sd->pincode, newpin, sizeof(sd->pincode));
+ safestrncpy(sd->pincode, newpin, sizeof(sd->pincode));
pincode->sendstate( fd, sd, PINCODE_ASK );
}
@@ -114,7 +114,7 @@ void pincode_notifyLoginPinUpdate(int account_id, char* pin) {
WFIFOHEAD(chr->login_fd,11);
WFIFOW(chr->login_fd,0) = 0x2738;
WFIFOL(chr->login_fd,2) = account_id;
- strncpy( (char*)WFIFOP(chr->login_fd,6), pin, 5 );
+ safestrncpy( (char*)WFIFOP(chr->login_fd,6), pin, 5 );
WFIFOSET(chr->login_fd,11);
}