Commit 3e3a8b05 authored by David Lawrence's avatar David Lawrence
Browse files

"lwconfig.c", line 438: remark(1506): implicit conversion from "long" to

          "unsigned char":  rounding, sign extension, or loss of accuracy may
          result

Fixed by ensuring suitable range before assignment.
parent 80056496
......@@ -411,8 +411,7 @@ lwres_conf_parsesortlist(lwres_context_t *ctx, FILE *fp) {
}
static lwres_result_t
lwres_conf_parseoption(lwres_context_t *ctx, FILE *fp)
{
lwres_conf_parseoption(lwres_context_t *ctx, FILE *fp) {
int delim;
long ndots;
char *p;
......@@ -435,6 +434,8 @@ lwres_conf_parseoption(lwres_context_t *ctx, FILE *fp)
ndots = strtol(word + 6, &p, 10);
if (*p != '\0') /* Bad string. */
return (LWRES_R_FAILURE);
if (ndots < 0 || ndots > 0xff) /* Out of range. */
return (LWRES_R_FAILURE);
confdata->ndots = ndots;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment