Skip to content

Commit

Permalink
Merge branch 'master' into coverity_scan
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Oct 24, 2016
2 parents 570093a + 0189727 commit 46bed68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion modules/httpd/httpd_proc.c
Expand Up @@ -408,7 +408,7 @@ int answer_to_connection (void *cls, struct MHD_Connection *connection,

LM_DBG("START *** cls=%p, connection=%p, url=%s, method=%s, "
"versio=%s, upload_data[%zu]=%p, *con_cls=%p\n",
cls, connection, url, method, version,
cls, connecti on, url, method, version,
*upload_data_size, upload_data, *con_cls);

pr = *con_cls;
Expand Down Expand Up @@ -648,6 +648,8 @@ int answer_to_connection (void *cls, struct MHD_Connection *connection,
(MHD_ContentReaderCallback)cb->flush_data_callback,
(void*)async_data,
NULL);
} else {
return -1;
}
if (cnt_type==HTTPD_TEXT_XML_CNT_TYPE || accept_type==HTTPD_TEXT_XML_CNT_TYPE)
MHD_add_response_header(response,
Expand Down
10 changes: 7 additions & 3 deletions modules/sms/libsms_getsms.c
Expand Up @@ -283,7 +283,9 @@ static int splitascii(struct modem *mdm, char *source, struct incame_sms *sms)
if (!*start)
return 1;
start++;
strncpy(sms->ascii,start,500);
strncpy(sms->ascii,start,sizeof(sms->ascii));
/* force \0 at end */
sms->ascii[sizeof(sms->ascii)] = 0;
/* get the senders MSISDN */
start=strstr(source,"\",\"");
if (start==0) {
Expand All @@ -297,7 +299,8 @@ static int splitascii(struct modem *mdm, char *source, struct incame_sms *sms)
return 1;
}
*end=0;
strncpy(sms->sender,start,500);
strncpy(sms->sender,start,sizeof(sms->sender));
sms->sender[sizeof(sms->sender) - 1] = 0;
/* Siemens M20 inserts the senders name between MSISDN and date */
start=end+3;
// Workaround for Thomas Stoeckel //
Expand All @@ -310,7 +313,8 @@ static int splitascii(struct modem *mdm, char *source, struct incame_sms *sms)
return 1;
}
*end=0;
strncpy(sms->name,start,500);
strncpy(sms->name,start,sizeof(sms->name));
sms->name[sizeof(sms->name - 1)] = 0;
}
/* Get the date */
start=end+3;
Expand Down

0 comments on commit 46bed68

Please sign in to comment.