...
 
Commits (3)
......@@ -2749,7 +2749,7 @@ js_listening_socket_constructor(JSContext *cx, uintN argc, jsval *arglist)
uint16_t port;
jsrefcount rc;
scfg_t *scfg;
struct xpms_set *set;
struct xpms_set *set = NULL;
struct ls_cb_data cb;
jsuint count;
int i;
......
......@@ -854,6 +854,7 @@ js_uifc_list(JSContext *cx, uintN argc, jsval *arglist)
return(JS_FALSE);
for(; argn<argc; argn++) {
if(JSVAL_IS_STRING(argv[argn])) {
free(title);
JSVALUE_TO_MSTRING(cx, argv[argn], title, NULL);
HANDLE_PENDING(cx, title);
continue;
......
......@@ -3522,6 +3522,7 @@ sbbs_t::sbbs_t(ushort node_num, union xp_sockaddr *addr, size_t addr_len, const
getstr_offset = 0;
lastnodemsg = 0;
xtrn_mode = 0;
last_ns_time = 0;
}
//****************************************************************************
......
......@@ -135,7 +135,7 @@ uint getsub(void)
opt[k][0]=0;
sprintf(str,"Select %s Sub-board",cfg.grp[i]->sname);
j=uifc.list(WIN_RHT|WIN_BOT|WIN_SAV,0,0,45,&sub_dflt,&sub_bar,str,opt);
if(j==-1 || j >= cfg.total_subs)
if(j==-1 || j >= k)
continue;
sub_dflt++;
sub_bar++;
......
......@@ -632,14 +632,24 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, long mode,
return(false);
}
length=(long)filelength(file);
if(length < 0) {
errormsg(WHERE, ERR_LEN, msgtmp, length);
free(buf);
return false;
}
l=strlen((char *)buf); /* reserve space for top and terminating null */
/* truncate if too big */
if(length>(long)((cfg.level_linespermsg[useron_level]*MAX_LINE_LEN)-(l+1))) {
length=(cfg.level_linespermsg[useron_level]*MAX_LINE_LEN)-(l+1);
bputs(text[OutOfBytes]);
}
lread(file,buf+l,length);
long rd = read(file,buf+l,length);
close(file);
if(rd != length) {
errormsg(WHERE, ERR_READ, msgtmp, length);
free(buf);
return false;
}
// remove(msgtmp); /* no need to save the temp input file */
buf[l+length]=0;
}
......@@ -845,7 +855,7 @@ void sbbs_t::removeline(char *str, char *str2, char num, char skip)
errormsg(WHERE,ERR_ALLOC,str,flen);
return;
}
if(lread(file,buf,flen)!=flen) {
if(read(file,buf,flen)!=flen) {
close(file);
errormsg(WHERE,ERR_READ,str,flen);
free(buf);
......
......@@ -133,6 +133,7 @@ struct xpmapping* DLLCALL xpmap(const char *filename, enum xpmap_type type)
ret=(struct xpmapping *)malloc(sizeof(struct xpmapping));
if(ret==NULL) {
CloseHandle(md);
UnmapViewOfFile(addr);
return NULL;
}
ret->addr=addr;
......