mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Coverity fixes: src/node.cc
This commit is contained in:
1 parent
c8dba94ff6
commit
4e3c5d88b3
2 files changed
+16
-10
No files matched your search
+2
-2
@@ -1142,7 +1142,7 @@ static Handle<Value> GetAddrInfo(const Arguments& args) {
|
||||
Local<Function> cb = Local<Function>::Cast(args[2]);
|
||||
|
||||
struct resolve_request *rreq = (struct resolve_request *)
|
||||
calloc(1, sizeof(struct resolve_request) + hostname.length());
|
||||
calloc(1, sizeof(struct resolve_request) + hostname.length() + 1);
|
||||
|
||||
if (!rreq) {
|
||||
V8::LowMemoryNotification();
|
||||
@@ -1150,7 +1150,7 @@ static Handle<Value> GetAddrInfo(const Arguments& args) {
|
||||
String::New("Could not allocate enough memory")));
|
||||
}
|
||||
|
||||
strcpy(rreq->hostname, *hostname);
|
||||
strncpy(rreq->hostname, *hostname, hostname.length() + 1);
|
||||
rreq->cb = Persistent<Function>::New(cb);
|
||||
rreq->ai_family = fam;
|
||||
|
||||
|
||||
Reference in new issue
Block a user