Browse Source

Check for callback argument in PTR lookup

v0.7.4-release
Krishna Rajendran 15 years ago
committed by Ryan Dahl
parent
commit
84277ea845
  1. 5
      src/node_dns.cc
  2. 5
      test/disabled/test-dns.js

5
src/node_dns.cc

@ -443,6 +443,11 @@ static Handle<Value> Reverse(const Arguments& args) {
String::New("Argument must be a string."))); String::New("Argument must be a string.")));
} }
if (!args[1]->IsFunction()) {
return ThrowException(Exception::Error(
String::New("Missing callback argument")));
}
String::Utf8Value ip_address(args[0]->ToString()); String::Utf8Value ip_address(args[0]->ToString());
union { union {

5
test/disabled/test-dns.js

@ -8,7 +8,10 @@ var dns = require("dns"),
assert.throws(function () { assert.throws(function () {
dns.resolve('google.com', 'A'); dns.resolve('google.com', 'A');
}) });
assert.throws(function () {
dns.resolve('127.0.0.1', 'PTR');
});
var hosts = ['example.com', 'example.org', var hosts = ['example.com', 'example.org',

Loading…
Cancel
Save