mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-01-28 01:47:18 +01:00
FirmwareImage: truncate name to max 64 characters
This commit is contained in:
parent
659b50b5bc
commit
9799ef78d6
1 changed files with 8 additions and 1 deletions
|
|
@ -1041,7 +1041,14 @@ static int set_DeviceInfoFirmwareImage_Alias(char *refparam, struct dmctx *ctx,
|
|||
|
||||
static int get_DeviceInfoFirmwareImage_Name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmjson_get_value((json_object *)data, 1, "fwver");
|
||||
char *name;
|
||||
|
||||
name = dmstrdup(dmjson_get_value((json_object *)data, 1, "fwver"));
|
||||
if (DM_STRLEN(name) > 64 ) {
|
||||
name[64] = '\0';
|
||||
}
|
||||
|
||||
*value = name;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue