mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-14 12:25:21 +00:00
8008114: [parfait] False positive buffer overrun in jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c
Reviewed-by: anthony, prr
This commit is contained in:
parent
e63f78cc99
commit
21e9bfc83e
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -229,8 +229,9 @@ static int deviceInfoIterator(UINT32 deviceID, snd_rawmidi_info_t *rawmidi_info,
|
||||
desc->deviceID = deviceID;
|
||||
|
||||
buffer[0]=' '; buffer[1]='[';
|
||||
// buffer[300] is enough to store the actual device string w/o overrun
|
||||
getDeviceStringFromDeviceID(&buffer[2], deviceID, usePlugHw, ALSA_RAWMIDI);
|
||||
strcat(buffer, "]");
|
||||
strncat(buffer, "]", sizeof(buffer) - strlen(buffer) - 1);
|
||||
strncpy(desc->name,
|
||||
(cardinfo != NULL)
|
||||
? snd_ctl_card_info_get_id(cardinfo)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -184,8 +184,9 @@ int deviceInfoIterator(UINT32 deviceID, snd_pcm_info_t* pcminfo,
|
||||
1 : snd_pcm_info_get_subdevices_count(pcminfo);
|
||||
*desc->deviceID = deviceID;
|
||||
buffer[0]=' '; buffer[1]='[';
|
||||
// buffer[300] is enough to store the actual device string w/o overrun
|
||||
getDeviceStringFromDeviceID(&buffer[2], deviceID, usePlugHw, ALSA_PCM);
|
||||
strcat(buffer, "]");
|
||||
strncat(buffer, "]", sizeof(buffer) - strlen(buffer) - 1);
|
||||
strncpy(desc->name,
|
||||
(cardinfo != NULL)
|
||||
? snd_ctl_card_info_get_id(cardinfo)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -229,8 +229,9 @@ static int deviceInfoIterator(UINT32 deviceID, snd_rawmidi_info_t *rawmidi_info,
|
||||
desc->deviceID = deviceID;
|
||||
|
||||
buffer[0]=' '; buffer[1]='[';
|
||||
// buffer[300] is enough to store the actual device string w/o overrun
|
||||
getDeviceStringFromDeviceID(&buffer[2], deviceID, usePlugHw, ALSA_RAWMIDI);
|
||||
strcat(buffer, "]");
|
||||
strncat(buffer, "]", sizeof(buffer) - strlen(buffer) - 1);
|
||||
strncpy(desc->name,
|
||||
(cardinfo != NULL)
|
||||
? snd_ctl_card_info_get_id(cardinfo)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -184,8 +184,9 @@ int deviceInfoIterator(UINT32 deviceID, snd_pcm_info_t* pcminfo,
|
||||
1 : snd_pcm_info_get_subdevices_count(pcminfo);
|
||||
*desc->deviceID = deviceID;
|
||||
buffer[0]=' '; buffer[1]='[';
|
||||
// buffer[300] is enough to store the actual device string w/o overrun
|
||||
getDeviceStringFromDeviceID(&buffer[2], deviceID, usePlugHw, ALSA_PCM);
|
||||
strcat(buffer, "]");
|
||||
strncat(buffer, "]", sizeof(buffer) - strlen(buffer) - 1);
|
||||
strncpy(desc->name,
|
||||
(cardinfo != NULL)
|
||||
? snd_ctl_card_info_get_id(cardinfo)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user