Browse code

snmpstats: fix allocator sizeof operand mismatch

(cherry picked from commit 0c99fed48403e2cc4f24441901b81b7c51411511)

Daniel-Constantin Mierla authored on 03/05/2022 17:07:41
Showing 2 changed files
... ...
@@ -520,7 +520,7 @@ void kamailioSIPRegUserLookupTable_set_action(netsnmp_request_group *rg)
520 520
 			case COLUMN_KAMAILIOSIPREGUSERLOOKUPURI:
521 521
 
522 522
 				row_ctx->kamailioSIPRegUserLookupURI =
523
-						pkg_malloc(sizeof(char) * (var->val_len + 1));
523
+						pkg_malloc(sizeof(unsigned char) * (var->val_len + 1));
524 524
 
525 525
 				memcpy(row_ctx->kamailioSIPRegUserLookupURI, var->val.string,
526 526
 						var->val_len);
... ...
@@ -776,4 +776,4 @@ kamailioSIPRegUserLookupTable_get_by_idx(netsnmp_index *hdr)
776 776
 {
777 777
 	return (const kamailioSIPRegUserLookupTable_context *)CONTAINER_FIND(
778 778
 			cb.container, hdr);
779
-}
780 779
\ No newline at end of file
780
+}
... ...
@@ -248,7 +248,7 @@ int createRegUserRow(char *stringToRegister)
248 248
 	theRow->kamailioSIPUserIndex = index;
249 249
 
250 250
 	theRow->kamailioSIPUserUri =
251
-			(unsigned char *)pkg_malloc(stringLength * sizeof(char));
251
+			(unsigned char *)pkg_malloc(stringLength * sizeof(unsigned char));
252 252
 	if(theRow->kamailioSIPUserUri == NULL) {
253 253
 		pkg_free(OIDIndex);
254 254
 		free(theRow);
... ...
@@ -378,4 +378,4 @@ const kamailioSIPRegUserTable_context *kamailioSIPRegUserTable_get_by_idx(
378 378
 {
379 379
 	return (const kamailioSIPRegUserTable_context *)CONTAINER_FIND(
380 380
 			cb.container, hdr);
381
-}
382 381
\ No newline at end of file
382
+}