Skip to content

Commit

Permalink
socket: protect against __proto__ deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 18, 2012
1 parent 2fa98fb commit bd37a9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ Socket.prototype.ack = function(){
*/

Socket.prototype.onack = function(packet){
var ack = this.acks[packet.id];
if (ack) {
var ack = this.acks[Number(packet.id)];
if ('function' == typeof ack) {
debug('calling ack %s with %j', packet.id, packet.data);
ack.apply(this, packet.data);
delete this.acks[packet.id];
} else {
debug('ack %s not found', packet.id);
debug('bad ack %s', packet.id);
}
};

Expand Down

0 comments on commit bd37a9a

Please sign in to comment.