summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_random.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-03-11Fixed undefined behaviour in left shift of int valueAndrei Zeliankou1-4/+4
Found by UndefinedBehaviorSanitizer: src/nxt_random.c:151:31: runtime error: left shift of 140 by 24 places cannot be represented in type 'int' #0 0x104f78968 in nxt_random nxt_random.c:151 #1 0x104f58a98 in nxt_shm_open nxt_port_memory.c:377 #2 0x10503e24c in nxt_controller_conf_send nxt_controller.c:617 #3 0x105041154 in nxt_controller_process_request nxt_controller.c:1109 #4 0x104fcdc48 in nxt_event_engine_start nxt_event_engine.c:542 #5 0x104f27254 in main nxt_main.c:35 #6 0x180fbd0dc (<unknown module>) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/nxt_random.c:151:31 Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
2018-07-27Removed implicit call of nxt_thread() in nxt_thread_tid().Valentin Bartenev1-1/+1
Explicit is better than implicit © The Zen of Python. The nxt_thread_tid(NULL) call was used only twice in the code and such behaviour was specific to nxt_thread_tid() function.
2018-07-16Added getentropy() support.Sergey Kandaurov1-0/+8
Prodded by David Carlier.
2018-06-25Introduced nxt_length() macro.Valentin Bartenev1-1/+1
2018-05-25Fixed a dead store.Sergey Kandaurov1-2/+4
Found by Clang Static Analyzer.
2018-05-24Using getrandom() libc interface, SYS_getrandom fixes.Sergey Kandaurov1-2/+6
The interface is available since Glibc 2.25, and FreeBSD 12.0.
2017-09-27Fixed building with pthread_t defined as a pointer.Sergey Kandaurov1-1/+1
2017-08-30Lib unit tests have been renamed to tests.Igor Sysoev1-5/+4
2017-07-10Introducing thread-safe nxt_random().Igor Sysoev1-5/+2
2017-01-17Initial version.Igor Sysoev1-0/+206