Opened 8 years ago

Closed 8 years ago

#5556 closed Bug (fixed)

jsn->jpr_root is allocated the wrong amount

Reported by: dhill Owned by: jordan
Priority: Normal Milestone: 2.83
Component: libtransmission Version: 2.82
Severity: Normal Keywords:
Cc:

Description

jpr_root is type size_t. allocate the proper amount of memory.

--- jsonsl.c.orig Sun Dec 8 20:28:29 2013 +++ jsonsl.c Sun Dec 8 20:28:39 2013 @@ -870,7 +870,7 @@

} jsn->jprs = malloc(sizeof(jsonsl_jpr_t) * njprs); jsn->jpr_count = njprs;

  • jsn->jpr_root = calloc(1, sizeof(int) * njprs * jsn->levels_max);

+ jsn->jpr_root = calloc(1, sizeof(size_t) * njprs * jsn->levels_max);

memcpy(jsn->jprs, jprs, sizeof(jsonsl_jpr_t) * njprs); /* Set the initial jump table values */

Change History (2)

comment:1 Changed 8 years ago by livings124

  • Component changed from Transmission to libtransmission
  • Owner set to jordan

comment:2 Changed 8 years ago by jordan

  • Milestone changed from None Set to 2.83
  • Resolution set to fixed
  • Status changed from new to closed

Thanks!

I've fixed this in our local copy of jsonsl with r14216 and have reported it upstream to the jsonsl project at https://github.com/mnunberg/jsonsl/issues/6

Note: See TracTickets for help on using tickets.