input
stringlengths
205
73.3k
output
stringlengths
64
73.2k
instruction
stringclasses
1 value
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long putAddCount() { return putAddCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; table = Table.create(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long rehashes() { return rehashes; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; table = Table.create(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; } #location 3 ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; table = Table.create(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long size() { return size; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long removeCount() { return removeCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long putAddCount() { return putAddCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code int hashTableSize() { return table.size(); } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; } #location 7 ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; } #location 8 ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; table = Table.create(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long evictedEntries() { return evictedEntries; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long capacity, long cleanUpTriggerFree) { this.capacity = capacity; this.freeCapacity = capacity; this.cleanUpTriggerFree = cleanUpTriggerFree; int hts = builder.getHashTableSize(); if (hts <= 0) ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long hitCount() { return hitCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long putAddCount() { return putAddCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long hitCount() { return hitCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; } #location 9 ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long putReplaceCount() { return putReplaceCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; } #location 4 ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; table = Table.create(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long hitCount() { return hitCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long rehashes() { return rehashes; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code boolean putEntry(long newHashEntryAdr, long hash, long keyLen, long bytes, boolean ifAbsent, long oldValueAdr, long oldValueLen) { long removeHashEntryAdr = 0L; LongArrayList derefList = null; lock.lock(); try { lo...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long rehashes() { return rehashes; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long size() { return size; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; } #location 9 ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; table = Table.create(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long size() { return size; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; table = Table.create(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; } #location 8 ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long lruCompactions() { return lruCompactions; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long cleanUpCount() { return cleanUpCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long capacity, long cleanUpTriggerFree) { this.capacity = capacity; this.freeCapacity = capacity; this.cleanUpTriggerFree = cleanUpTriggerFree; int hts = builder.getHashTableSize(); if (hts <= 0) ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long size() { return size; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; } #location 7 ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; table = Table.create(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long lruCompactions() { return lruCompactions; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code int hashTableSize() { return table.size(); } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long capacity, long cleanUpTriggerFree) { this.capacity = capacity; this.freeCapacity = capacity; this.cleanUpTriggerFree = cleanUpTriggerFree; int hts = builder.getHashTableSize(); if (hts <= 0) ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long putReplaceCount() { return putReplaceCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code boolean putEntry(long newHashEntryAdr, long hash, long keyLen, long bytes, boolean ifAbsent, long oldValueAddr, long oldValueOffset, long oldValueLen) { long removeHashEntryAdr = 0L; LongArrayList derefList = null; lock.lock(); try ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long removeCount() { return removeCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long removeCount() { return removeCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long freeCapacity() { return freeCapacity; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code int hashTableSize() { return table.size(); } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; } #location 3 ...
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long rehashes() { return rehashes; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long evictedEntries() { return evictedEntries; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long missCount() { return missCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long putAddCount() { return putAddCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long evictedEntries() { return evictedEntries; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; table = Table.create(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long putReplaceCount() { return putReplaceCount; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void release() { table.release(); } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long capacity, long cleanUpTriggerFree) { this.capacity = capacity; this.freeCapacity = capacity; this.cleanUpTriggerFree = cleanUpTriggerFree; int hts = builder.getHashTableSize(); if (hts <= 0) ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void resetStatistics() { rehashes = 0L; evictedEntries = 0L; hitCount = 0L; missCount = 0L; putAddCount = 0L; putReplaceCount = 0L; removeCount = 0L; lruCompactions = 0L; } ...
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long evictedEntries() { return evictedEntries; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, AtomicLong freeCapacity) { this.freeCapacity = freeCapacity; int hts = builder.getHashTableSize(); if (hts <= 0) hts = 8192; if (hts < 256) hts = 256; int bl = builder.getB...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code long freeCapacity() { return freeCapacity; } #location 3 #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code OffHeapMap(OHCacheBuilder builder, long freeCapacity) { this.freeCapacity = freeCapacity; this.throwOOME = builder.isThrowOOME(); this.lock = builder.isUnlocked() ? null : new ReentrantLock(); int hts = builder.getHashTableSize(); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public List<JadbDevice> getDevices() throws IOException, JadbException { Transport devices = createTransport(); devices.send("host:devices"); devices.verifyResponse(); String body = devices.readString(); devices.close(); r...
#fixed code public List<JadbDevice> getDevices() throws IOException, JadbException { try (Transport transport = createTransport()) { transport.send("host:devices"); transport.verifyResponse(); String body = transport.readString(); r...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void launch() throws IOException, InterruptedException { Process p = runtime.exec(new String[]{findAdbExecutable(), "start-server"}); p.waitFor(); int exitValue = p.exitValue(); if (exitValue != 0) throw new IOException("adb exited...
#fixed code public void launch() throws IOException, InterruptedException { Process p = subprocess.execute(new String[]{executable, "start-server"}); p.waitFor(); int exitValue = p.exitValue(); if (exitValue != 0) throw new IOException("adb exited with exi...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void launch(Package name) throws IOException, JadbException { InputStream s = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1"); } #location 2 ...
#fixed code public void launch(Package name) throws IOException, JadbException { InputStream s = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1"); s.close(); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void start() throws InterruptedException { thread = new Thread(this, "Fake Adb Server"); thread.setDaemon(true); thread.start(); synchronized (lockObject) { if (!isStarted) { lockObject.wait(); ...
#fixed code public void start() throws InterruptedException { thread = new Thread(this, "Fake Adb Server"); thread.setDaemon(true); thread.start(); serverReady(); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public String getHostVersion() throws IOException, JadbException { Transport main = createTransport(); main.send("host:version"); main.verifyResponse(); String version = main.readString(); main.close(); return version; ...
#fixed code public String getHostVersion() throws IOException, JadbException { try (Transport transport = createTransport()) { transport.send("host:version"); transport.verifyResponse(); return transport.readString(); } }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Deprecated public void executeShell(OutputStream output, String command, String... args) throws IOException, JadbException { Transport transport = getTransport(); StringBuilder shellLine = new StringBuilder(command); for (String arg : args) ...
#fixed code @Deprecated public void executeShell(OutputStream output, String command, String... args) throws IOException, JadbException { Transport transport = getTransport(); StringBuilder shellLine = new StringBuilder(command); for (String arg : args) { ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void pull(RemoteFile remote, File local) throws IOException, JadbException { FileOutputStream fileStream = new FileOutputStream(local); pull(remote, fileStream); fileStream.close(); } #location 5 ...
#fixed code public void pull(RemoteFile remote, File local) throws IOException, JadbException { try (FileOutputStream fileStream = new FileOutputStream(local)) { pull(remote, fileStream); } }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public List<RemoteFile> list(String remotePath) throws IOException, JadbException { Transport transport = getTransport(); SyncTransport sync = transport.startSync(); sync.send("LIST", remotePath); List<RemoteFile> result = new ArrayList<...
#fixed code public List<RemoteFile> list(String remotePath) throws IOException, JadbException { try (Transport transport = getTransport()) { SyncTransport sync = transport.startSync(); sync.send("LIST", remotePath); List<RemoteFile> result = n...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public Map<String, String> getprop() throws IOException, JadbException { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(device.executeShell("getprop"))); return parseProp(bufferedReader); } #loca...
#fixed code public Map<String, String> getprop() throws IOException, JadbException { BufferedReader bufferedReader = null; try { bufferedReader = new BufferedReader(new InputStreamReader(device.executeShell("getprop"))); return parseProp(bufferedRe...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public String readString(int length) throws IOException { DataInput reader = new DataInputStream(inputStream); byte[] responseBuffer = new byte[length]; reader.readFully(responseBuffer); return new String(responseBuffer, StandardCharsets....
#fixed code public String readString(int length) throws IOException { byte[] responseBuffer = new byte[length]; dataInput.readFully(responseBuffer); return new String(responseBuffer, StandardCharsets.UTF_8); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void push(File local, RemoteFile remote) throws IOException, JadbException { FileInputStream fileStream = new FileInputStream(local); push(fileStream, local.lastModified(), getMode(local), remote); fileStream.close(); } ...
#fixed code public void push(File local, RemoteFile remote) throws IOException, JadbException { try (FileInputStream fileStream = new FileInputStream(local)) { push(fileStream, local.lastModified(), getMode(local), remote); } }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private byte[] passthrough(byte[] input) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream(); OutputStream sut = new AdbFilterOutputStream(output); sut.write(input); sut.flush(); return output.toByteArr...
#fixed code private byte[] passthrough(byte[] input) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream(); OutputStream sut = new AdbFilterOutputStream(output); try { sut.write(input); sut.flush(); } finally { ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void runServer() throws IOException { DataInput input = new DataInputStream(socket.getInputStream()); DataOutputStream output = new DataOutputStream(socket.getOutputStream()); while (true) { byte[] buffer = new byte[4]; ...
#fixed code private void runServer() throws IOException { DataInput input = new DataInputStream(socket.getInputStream()); DataOutputStream output = new DataOutputStream(socket.getOutputStream()); while (processCommand(input, output)) { // nothing ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void start() throws InterruptedException { thread = new Thread(this, "Fake Adb Server"); thread.setDaemon(true); thread.start(); synchronized (lockObject) { if (!isStarted) { lockObject.wait(); ...
#fixed code public void start() throws InterruptedException { thread = new Thread(this, "Fake Adb Server"); thread.setDaemon(true); thread.start(); serverReady(); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void vanilla() { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( TestConfiguration.class); Service service = context.getBean(Service.class); service.service(); assertEquals(3, service.getCount()); context.clo...
#fixed code @Test public void vanilla() { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( TestConfiguration.class); Service service = context.getBean(Service.class); Foo foo = context.getBean(Foo.class); assertFalse(AopUtils.isAopProxy(foo))...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Test public void testEmpytObjectCRC() { String key = "empty-object-crc"; try { // put PutObjectResult putObjectResult = ossClient.putObject(bucketName, key, new ByteArrayInputStream(new String("").getByte...
#fixed code @Test public void testEmpytObjectCRC() { String key = "empty-object-crc"; try { // put PutObjectResult putObjectResult = ossClient.putObject(bucketName, key, new ByteArrayInputStream(new String("").getBytes()));...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void load(File file) throws IOException { InputStream in = new FileInputStream(file); load(in); in.close(); } #location 5 #vulnerability type RESOURCE_LEAK
#fixed code public void load(File file) throws IOException { InputStream in = null; try { in = new FileInputStream(file); load(in); } finally { if (in != null) { in.close(); } } }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { String token = request.getHeader(Constant.TOKEN); if(StrUtil.isNotBlank(token)){ ...
#fixed code @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { String token = request.getHeader(Constant.TOKEN); if(StrUtil.isNotBlank(token) && !StrUtil.equals(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @SneakyThrows @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication){ String token; if(authentication.getPrincipal() instanceof CustomUserDetailsUser){ Cu...
#fixed code @SneakyThrows @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication){ String token; Long userId = 0l; if(authentication.getPrincipal() instanceof CustomUserDetailsU...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @SneakyThrows @Override public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { String token = request.getHeader(Constant.TOKEN); redisTemplate.delete(Constant.AUTHENTICATION_TOKEN); b...
#fixed code @SneakyThrows @Override public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) { String token = request.getHeader(Constant.TOKEN); redisTemplate.delete(Constant.AUTHENTICATION_TOKEN); redisTe...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private List<BOBRequestDetail> getRequestBOBDetails() { if (requestBOBDetails == null) { List<String> detailLines = getDetailLines(); if (detailLines == null) return null; BOBRequestDetail detail; requestBOBDetai...
#fixed code private List<BOBRequestDetail> getRequestBOBDetails() { if (requestBOBDetails == null) { List<String> detailLines = getDetailLines(); if (detailLines == null) return null; BOBRequestDetail detail; requestBOBDetails = n...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public String getResponseBody() throws IOException { String contentType = getContentType(); String charset = "UTF-8"; if (contentType != null) { for (String part : contentType.split(";")) { if (part.start...
#fixed code @Override public String getResponseBody() throws IOException { String contentType = getContentType(); String charset = "UTF-8"; if (contentType != null) { for (String part : contentType.split(";")) { if (part.startsWith(...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override public String getResponseBodyExcerpt(int maxLength) throws IOException { String contentType = getContentType(); String charset = "UTF-8"; if (contentType != null) { for (String part : contentType.split(";")) { ...
#fixed code @Override public String getResponseBodyExcerpt(int maxLength) throws IOException { String contentType = getContentType(); String charset = "UTF-8"; if (contentType != null) { for (String part : contentType.split(";")) { ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code Results run(String tomlString) { if (tomlString.isEmpty()) { return results; } String[] lines = tomlString.split("[\\n\\r]"); StringBuilder multilineBuilder = new StringBuilder(); Multiline multiline = Multiline.NONE; String key = null;...
#fixed code Results run(String tomlString) { if (tomlString.isEmpty()) { return results; } String[] lines = tomlString.split("[\\n\\r]"); StringBuilder multilineBuilder = new StringBuilder(); Multiline multiline = Multiline.NONE; String key = null; S...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private String readFile(File input) throws IOException { BufferedReader bufferedReader = new BufferedReader(new FileReader(input)); StringBuilder w = new StringBuilder(); String line = bufferedReader.readLine(); while (line != null) { w.append(line)...
#fixed code private String readFile(File input) throws IOException { BufferedReader bufferedReader = new BufferedReader(new FileReader(input)); try { StringBuilder w = new StringBuilder(); String line = bufferedReader.readLine(); while (line != null) { w....
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @SuppressWarnings("unchecked") @Test public void should_parse_example() throws Exception { TomlParser parser = Parboiled.createParser(TomlParser.class); String toml = new Scanner(new File(getClass().getResource("example.toml").getFile())).useDelimiter("\\Z")....
#fixed code @SuppressWarnings("unchecked") @Test public void should_parse_example() throws Exception { Toml toml = new Toml().parse(new File(getClass().getResource("example.toml").getFile())); // printMap(root); assertEquals("TOML Example", toml.getString("title")); ...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void write(Object from, File target) throws IOException { FileWriter writer = new FileWriter(target); writer.write(write(from)); writer.close(); } #location 5 #vulnerability type RESOURCE_LEAK
#fixed code public void write(Object from, File target) throws IOException { FileWriter writer = new FileWriter(target); write(from, writer); writer.close(); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void write(Object from, OutputStream target) throws IOException { OutputStreamWriter writer = new OutputStreamWriter(target); write(from, writer); writer.flush(); } #location 5 #vulnerability t...
#fixed code public void write(Object from, OutputStream target) throws IOException { OutputStreamWriter writer = new OutputStreamWriter(target, "UTF-8"); write(from, writer); writer.flush(); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void write(Object from, OutputStream target) throws IOException { OutputStreamWriter writer = new OutputStreamWriter(target); write(from, writer); writer.flush(); } #location 4 #vulnerability t...
#fixed code public void write(Object from, OutputStream target) throws IOException { OutputStreamWriter writer = new OutputStreamWriter(target, "UTF-8"); write(from, writer); writer.flush(); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public Toml parse(File file) { try { return parse(new Scanner(file).useDelimiter("\\Z").next()); } catch (FileNotFoundException e) { throw new RuntimeException(e); } } #location 3 #vulnera...
#fixed code public Toml parse(File file) { Scanner scanner = null; try { scanner = new Scanner(file); return parse(scanner.useDelimiter("\\Z").next()); } catch (FileNotFoundException e) { throw new RuntimeException(e); } finally { if (scanner != nul...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public boolean filmlisteIstAelter(int sekunden) { // Filmliste ist älter als: FilmeLaden.ALTER_FILMLISTE_SEKUNDEN_FUER_AUTOUPDATE int ret = -1; Date jetzt = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat...
#fixed code public boolean filmlisteIstAelter(int sekunden) { int ret = alterFilmlisteSek(); // Date jetzt = new Date(System.currentTimeMillis()); // SimpleDateFormat sdf = new SimpleDateFormat(DATUM_ZEIT_FORMAT); // String date = metaDaten[ListeFilme.FILMLIS...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code @Override void meldungThreadUndFertig() { //wird erst ausgeführt wenn alle Threads beendet sind if (threads <= 0) { // sonst läuft noch was laufeSchon = false; } super.meldungThreadUndFertig(); } ...
#fixed code @Override void meldungThreadUndFertig() { //wird erst ausgeführt wenn alle Threads beendet sind if (threads <= 0) { // sonst läuft noch was lSchon = false; } super.meldungThreadUndFertig(); }
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void starten() { daten = new Daten(pfad); Daten.nogui = true; if (!userAgent.equals("")) { Daten.setUserAgentManuel(userAgent); } // Infos schreiben Log.startMeldungen(this.getClass().getName()); ...
#fixed code public void starten() { daten = new Daten(pfad); Daten.nogui = true; if (!userAgent.equals("")) { Daten.setUserAgentManuel(userAgent); } // Infos schreiben Log.startMeldungen(this.getClass().getName()); if (s...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public static String getPfadVlc() { /////////////////////// if (!Daten.system[Konstanten.SYSTEM_PFAD_VLC_NR].equals("")) { return Daten.system[Konstanten.SYSTEM_PFAD_VLC_NR]; } final String PFAD_LINUX_VLC = "/usr/bin/vlc"; ...
#fixed code public static String getPfadVlc() { if (Daten.system[Konstanten.SYSTEM_PFAD_VLC_NR].equals("")) { new DialogOk(null, true, new PanelProgrammPfade(), "Pfade Standardprogramme").setVisible(true); } return Daten.system[Konstanten.SYSTEM_PFAD_V...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public static String getPfadFlv() { ///////////////////// if (!Daten.system[Konstanten.SYSTEM_PFAD_FLVSTREAMER_NR].equals("")) { return Daten.system[Konstanten.SYSTEM_PFAD_FLVSTREAMER_NR]; } final String PFAD_LINUX_FLV = "/usr...
#fixed code public static String getPfadFlv() { if (Daten.system[Konstanten.SYSTEM_PFAD_FLVSTREAMER_NR].equals("")) { new DialogOk(null, true, new PanelProgrammPfade(), "Pfade Standardprogramme").setVisible(true); } return Daten.system[Konstanten.SYSTE...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void listeBauen() { //LinkedList mit den URLs aus dem Logfile bauen LineNumberReader in = null; File datei = null; try { datei = new File(Daten.getBasisVerzeichnis(false) + Konstanten.LOG_DATEI_DOWNLOAD_ABOS); ...
#fixed code private void listeBauen() { //LinkedList mit den URLs aus dem Logfile bauen Path downloadAboFilePath = Daten.getDownloadAboFilePath(); //use Automatic Resource Management try (LineNumberReader in = new LineNumberReader(new InputStreamReader(Fil...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public static String getPfadVlc() { /////////////////////// if (!Daten.system[Konstanten.SYSTEM_PFAD_VLC_NR].equals("")) { return Daten.system[Konstanten.SYSTEM_PFAD_VLC_NR]; } final String PFAD_LINUX_VLC = "/usr/bin/vlc"; ...
#fixed code public static String getPfadVlc() { if (Daten.system[Konstanten.SYSTEM_PFAD_VLC_NR].equals("")) { new DialogOk(null, true, new PanelProgrammPfade(), "Pfade Standardprogramme").setVisible(true); } return Daten.system[Konstanten.SYSTEM_PFAD_V...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code private void metaDatenSchreiben() { // FilmlisteMetaDaten listeFilmeNeu.metaDaten = ListeFilme.newMetaDaten(); if (!Daten.filmeLaden.getStop() /* löschen */) { listeFilmeNeu.metaDaten[ListeFilme.FILMLISTE_DATUM_NR] = DatumZeit.getJetz...
#fixed code private void metaDatenSchreiben() { // FilmlisteMetaDaten listeFilmeNeu.metaDaten = ListeFilme.newMetaDaten(); if (!Daten.filmeLaden.getStop() /* löschen */) { listeFilmeNeu.metaDaten[ListeFilme.FILMLISTE_DATUM_NR] = DatumZeit.getJetzt_ddMM...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public static String getMusterPfadMplayer() { final String PFAD_LINUX = "/usr/bin/mplayer"; final String PFAD_MAC = "/opt/local/bin/mplayer"; String pfad = ""; if (System.getProperty("os.name").toLowerCase().contains("windows")) { ...
#fixed code public static String getMusterPfadMplayer() { final String PFAD_LINUX = "/usr/bin/mplayer"; final String PFAD_MAC = "/opt/local/bin/mplayer"; final String PFAD_WIN_DEFAULT = "C:\\Program Files\\SMPlayer\\mplayer\\mplayer.exe"; final String PFAD...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code void ladenHttp(String filmWebsite, String thema, String alter) { // erst die Nummer suchen // >25420<4<165<23. Die b // <http://www.kikaplus.net/clients/kika/mediathek/previewpic/1355302530-f80b463888fd4602d925b2ef2c861928 9.jpg< final St...
#fixed code void addToListNormal() { //<strong style="margin-left:10px;">Sesamstraße präsentiert: Eine Möhre für Zwei</strong><br /> //<a style="margin-left:20px;" href="?programm=168&amp;id=14487&amp;ag=5" title="Sendung vom 10.10.2012" class="overlay_link">42. Ordnung i...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public static String getMusterPfadMplayer() { final String PFAD_LINUX = "/usr/bin/mplayer"; final String PFAD_MAC = "/opt/local/bin/mplayer"; String pfad = ""; if (System.getProperty("os.name").toLowerCase().contains("windows")) { ...
#fixed code public static String getMusterPfadMplayer() { final String PFAD_LINUX = "/usr/bin/mplayer"; final String PFAD_MAC = "/opt/local/bin/mplayer"; final String PFAD_WIN_DEFAULT = "C:\\Program Files\\SMPlayer\\mplayer\\mplayer.exe"; final String PFAD...
Below is the vulnerable code, please generate the patch based on the following information.
#vulnerable code public void starten() { daten = new Daten(pfad); Daten.nogui = true; if (!userAgent.equals("")) { Daten.setUserAgentManuel(userAgent); } // Infos schreiben Log.startMeldungen(this.getClass().getName()); ...
#fixed code public void starten() { daten = new Daten(pfad); Daten.nogui = true; if (!userAgent.equals("")) { Daten.setUserAgentManuel(userAgent); } // Infos schreiben Log.startMeldungen(this.getClass().getName()); if (s...
Below is the vulnerable code, please generate the patch based on the following information.